GFDropdown<T> class

Inheritance

Constructors

GFDropdown({Key? key, required List<DropdownMenuItem<T>>? items, Widget? icon, DropdownButtonBuilder? selectedItemBuilder, T? value, Widget? hint, Widget? disabledHint, required ValueChanged<T?>? onChanged, VoidCallback? onTap, int elevation = 8, TextStyle? style, Widget? underline, Color? iconDisabledColor, Color? iconEnabledColor, double iconSize = 24.0, bool isDense = true, bool isExpanded = false, double? itemHeight = 40, Color? focusColor, FocusNode? focusNode, bool autofocus = false, Color? dropdownColor, FormFieldValidator<T>? validator, EdgeInsets padding = const EdgeInsets.all(8), BorderRadius borderRadius = const BorderRadius.all(Radius.circular(4)), BorderSide border = const BorderSide(color: Colors.transparent, width: 1, style: BorderStyle.solid), dynamic dropdownButtonColor = GFColors.WHITE})
GF Dropdown let user to select from the number of items and display selected item in the button. It displays list of items in the overlay dropdown fashion.
const

Properties

autofocus bool
On true state it should focus itself if nothing else is already focused. Defaults to false
final
border BorderSide
Defines the border of dropdown button
final
borderRadius BorderRadius
Defines the border radius of the dropdown.
final
disabledHint Widget?
A message to show when the dropdown is disabled.
final
Defines the background color of the dropdownButton.
final
Defines the background color of the dropdown.
final
elevation int
The z-coordinate at which to place the menu when open.
final
focusColor Color?
The color for the button's Material when it has the input focus.
final
focusNode FocusNode?
Defines the keyboard focus for this widget.
final
hashCode int
The hash code for this object.
no setterinherited
hint Widget?
A placeholder widget that is displayed by the dropdown button.
final
icon Widget?
The widget to use for the drop-down button's icon. Defaults to an Icon with the Icons.arrow_drop_down glyph.
final
iconDisabledColor Color?
The color of any Icon descendant of icon if this button is disabled, i.e. if onChanged is null.
final
iconEnabledColor Color?
The color of any Icon descendant of icon if this button is enabled, i.e. if onChanged is defined.
final
iconSize double
The size to use for the drop-down button's down arrow icon button.
final
isDense bool
Reduce the button's height.
final
isExpanded bool
Set the dropdown's inner contents to horizontally fill its parent.
final
itemHeight double?
Defines the height of the menu items
final
items List<DropdownMenuItem<T>>?
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
onChanged ValueChanged<T?>?
Called when the user selects an item. If the onChanged callback is null or the list of DropdownButton.items is null then the dropdown button will be disabled,
final
onTap VoidCallback?
Called when the dropdown button is tapped.
final
padding EdgeInsets
Defines the padding given inside the dropdown
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
selectedItemBuilder DropdownButtonBuilder?
final
style TextStyle?
Defaults to the TextTheme.titleMedium value of the current ThemeData.textTheme of the current Theme.
final
underline Widget?
The widget to use for drawing the drop-down button's underline.
final
validator FormFieldValidator<T>?
An optional method that validates an input. Returns an error string to display if the input is invalid, or null otherwise.
final
value → T?
The value of the currently selected DropdownMenuItem.
final

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() State<GFDropdown<T>>
Creates the mutable state for this widget at a given location in the tree.
override
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}) 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