DistrictDropdown class

A customizable dropdown widget to select a district. Provides fine-grained control over layout, styling, and behavior.

Inheritance

Constructors

DistrictDropdown({Key? key, required List<DistrictModel> districts, required DistrictModel? selectedDistrict, required ValueChanged<DistrictModel?> onChanged, Widget? hint, Widget? disabledHint, double? iconSize, TextStyle? style, bool isExpanded = true, Widget? icon, Color? dropdownColor, InputDecoration? decoration, BorderRadius? borderRadius, double? width, double? height, Widget? underline, AlignmentGeometry alignment = AlignmentDirectional.centerStart, bool? enableFeedback, FocusNode? focusNode, bool autofocus = false, EdgeInsetsGeometry? padding, BoxDecoration? boxDecoration})
const

Properties

alignment AlignmentGeometry
alignment is the alignment of the dropdown content.
final
autofocus bool
autofocus determines if the dropdown should gain focus automatically.
final
borderRadius BorderRadius?
borderRadius is the border radius applied to the dropdown container.
final
boxDecoration BoxDecoration?
boxDecoration is the decoration applied to the dropdown container.
final
decoration InputDecoration?
decoration is the decoration applied to the dropdown container.
final
disabledHint Widget?
disabledHint is the widget displayed when the dropdown is disabled.
final
districts List<DistrictModel>
districts is a list of districts to be displayed in the dropdown.
final
dropdownColor is the background color of the dropdown.
final
enableFeedback bool?
enableFeedback determines if the dropdown should provide haptic feedback on selection.
final
focusNode FocusNode?
focusNode is the focus node for the dropdown.
final
hashCode int
The hash code for this object.
no setterinherited
height double?
Fixed height for the dropdown (used when isExpanded is false).
final
hint Widget?
hint is the widget displayed when no district is selected.
final
icon Widget?
icon is the icon displayed in the dropdown.
final
iconSize double?
iconSize is the size of the dropdown icon.
final
isExpanded bool
isExpanded determines if the dropdown should take the full width of its parent.
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
onChanged ValueChanged<DistrictModel?>
onChanged is a callback function that is triggered when the selected district changes.
final
padding EdgeInsetsGeometry?
padding is the padding applied to the dropdown container.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
selectedDistrict DistrictModel?
selectedDistrict is the currently selected district.
final
style TextStyle?
style is the text style applied to the dropdown items.
final
underline Widget?
underline is the widget displayed below the dropdown.
final
width double?
Fixed width for the dropdown (used when isExpanded is false).
final

Methods

build(BuildContext context) Widget
Describes the part of the user interface represented by this widget.
override
createElement() StatelessElement
Creates a StatelessElement to manage this widget's location in the tree.
inherited
debugDescribeChildren() List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children.
inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style}) DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep.
inherited
toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) String
A string representation of this object.
inherited
toStringDeep({String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) String
Returns a string representation of this node and its descendants.
inherited
toStringShallow({String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a one-line detailed description of the object.
inherited
toStringShort() String
A short, textual description of this widget.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited