ModularCustomizableDropdown class

A dropdown extension for any widget.

I have provided three factory constructors to help you get started, but you are welcome to assemble your own using the component's constructor.

Pass any widget as the target of this dropdown, and the dropdown will automagically appear below the widget when you click on it!

Inheritance

Constructors

ModularCustomizableDropdown({required ReactMode reactMode, required dynamic onValueSelect(DropdownValue selectedValue), required List<DropdownValue> allDropdownValues, required bool barrierDismissible, required DropdownStyle dropdownStyle, required bool collapseOnSelect, void onDropdownVisibilityChange(bool visible)?, CallbackReactParams? callbackReactParams, TapReactParams? tapReactParams, FocusReactParams? focusReactParams, List<Key>? rowKeys, Key? listviewKey, Key? offStageWidgetKey, Key? overlayEntryKey, Key? key})
const
ModularCustomizableDropdown.displayOnCallback({required dynamic onValueSelect(DropdownValue selectedValue), required List<DropdownValue> allDropdownValues, required Widget targetBuilder(void toggleDropdown(bool toggleState)), required bool collapseOnSelect, bool barrierDismissible = true, DropdownStyle style = const DropdownStyle(invertYAxisAlignmentWhenOverflow: true), Key? key, @visibleForTesting Key? listviewKey, @visibleForTesting Key? overlayEntryKey, @visibleForTesting Key? offStageWidgetKey, @visibleForTesting List<Key>? rowKeys})
Expose a toggle callback in the target builder method.
factory
ModularCustomizableDropdown.displayOnFocus({required dynamic onValueSelect(DropdownValue selectedValue), required List<DropdownValue> allDropdownValues, required Widget targetBuilder(FocusNode focusNode, TextEditingController textController), required TextEditingController textController, required FocusNode focusNode, bool setTextToControllerOnSelect = true, bool collapseOnSelect = true, bool barrierDismissible = true, dynamic onDropdownVisible(bool)?, DropdownStyle style = const DropdownStyle(invertYAxisAlignmentWhenOverflow: true), Key? key, @visibleForTesting Key? listviewKey, @visibleForTesting Key? overlayEntryKey, @visibleForTesting Key? offStageWidgetKey, @visibleForTesting List<Key>? rowKeys})
Same as displayOnTap, but also triggers dropdown when the target is in focus
factory
ModularCustomizableDropdown.displayOnTap({required dynamic onValueSelect(DropdownValue selectedValue), required List<DropdownValue> allDropdownValues, required Widget target, dynamic onDropdownVisible(bool)?, bool barrierDismissible = true, DropdownStyle style = const DropdownStyle(invertYAxisAlignmentWhenOverflow: true), bool collapseOnSelect = true, Key? key, @visibleForTesting Key? overlayEntryKey, @visibleForTesting Key? offStageWidgetKey, @visibleForTesting Key? listviewKey, @visibleForTesting List<Key>? rowKeys})
Automatically displays the dropdown when the target is clicked
factory

Properties

allDropdownValues List<DropdownValue>
When the asTextFieldDropdown factory constructor is called, dropdown will allow an additional ability to filter the list based on the textController's value.
final
barrierDismissible bool
Allows user to click outside dropdown to dismiss
final
callbackReactParams CallbackReactParams?
React to callback events.
final
collapseOnSelect bool
Dispose dropdown on value select?
final
final
focusReactParams FocusReactParams?
React to focus.
final
hashCode int
The hash code for this object.
no setterinherited
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
listviewKey Key?
For testing the final "visible" height of the dropdown
final
offStageWidgetKey Key?
A key that targets the offStage widget.
final
onDropdownVisibilityChange → (void Function(bool visible)?)
final
onValueSelect → dynamic Function(DropdownValue selectedValue)
Action to perform when the value is tapped.
final
overlayEntryKey Key?
A key that targets the overlayEntry widget (the dropdown).
final
reactMode ReactMode
The modes the dropdown should react to
final
rowKeys List<Key>?
For obtaining the individual height of each of the dropdown rows.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
tapReactParams TapReactParams?
React to only tap events.
final

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() → _ModularCustomizableDropdownState
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