HierarchySearchableDropdown class
A premium, customizable hierarchical dropdown with search and multi-select support.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- HierarchySearchableDropdown
Constructors
-
HierarchySearchableDropdown({Key? key, required List<
HierarchyItem> items, String hint = 'Select items...', bool isMultiline = false, bool isMultiSelect = false, required ValueChanged<String> onChanged, HierarchyHeaderBuilder? headerBuilder, HierarchySearchBuilder? searchBuilder, HierarchyItemBuilder? itemBuilder, BoxDecoration? dropdownDecoration, double maxHeight = 500, TextStyle? itemTextStyle, TextAlign? itemTextAlign, EdgeInsets? itemPadding, EdgeInsets? listPadding, double? itemSpacing, double defaultIconHeight = 22, double defaultIconWidth = 22, double defaultIconBorderRadius = 6, String? validator(String?)?, double? buttonHeight, double? buttonWidth, double? dropdownHeight, double? dropdownWidth, Offset? offset, BoxDecoration? headerDecoration, InputDecoration? searchDecoration, BoxDecoration? searchBoxDecoration, TextStyle? searchStyle, Alignment targetAnchor = Alignment.bottomLeft, Alignment followerAnchor = Alignment.topLeft, bool showChips = false, BoxDecoration? chipDecoration, TextStyle? chipTextStyle, EdgeInsets? chipPadding, double? chipHeight, FocusNode? searchFocusNode, bool autoFocusSearch = false, Widget? headerPrefix, Widget? headerSuffix, bool clearSearchOnClose = true, Axis chipScrollDirection = Axis.horizontal, bool showSearch = true, bool isLoadingMore = false, VoidCallback? onLoadMore, Widget? loadingIndicator, bool enableAnimation = true, bool isGlassMode = false, double blur = 10, double connectivity = 0.1}) -
const
Properties
- autoFocusSearch → bool
-
Whether the search field should auto-focus when opened.
final
- blur → double
-
Blur amount for the glassmorphism effect.
final
-
Optional custom height for the dropdown trigger/button.
final
-
Optional custom width for the dropdown trigger/button.
final
- chipDecoration → BoxDecoration?
-
Optional decoration for the chips in the header.
final
- chipHeight → double?
-
Optional custom height for the chips in the header.
final
- chipPadding → EdgeInsets?
-
Optional padding for the chips in the header.
final
- chipScrollDirection → Axis
-
The scroll direction of the chips in the header.
final
- chipTextStyle → TextStyle?
-
Optional text style for the chips in the header.
final
- clearSearchOnClose → bool
-
Whether to clear the search query when the dropdown is closed.
final
- connectivity → double
-
Connectivity (white opacity) for the glassmorphism effect.
final
- defaultIconBorderRadius → double
-
Default border radius for icons/images if not specified per-item.
final
- defaultIconHeight → double
-
Default height for icons/images if not specified per-item.
final
- defaultIconWidth → double
-
Default width for icons/images if not specified per-item.
final
- dropdownDecoration → BoxDecoration?
-
Optional decoration for the dropdown panel content.
final
- dropdownHeight → double?
-
Optional custom height for the dropdown panel.
final
- dropdownWidth → double?
-
Optional custom width for the dropdown panel.
final
- enableAnimation → bool
-
Whether to enable entrance animations for items.
final
- followerAnchor → Alignment
-
Optional follower anchor for the dropdown panel position.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- headerBuilder → HierarchyHeaderBuilder?
-
Optional custom builder for the dropdown trigger.
final
- headerDecoration → BoxDecoration?
-
Optional custom decoration for the default header.
final
- headerPrefix → Widget?
-
Optional custom widget to show as prefix in the default header.
final
- headerSuffix → Widget?
-
Optional custom widget to show as suffix in the default header.
final
- hint → String
-
Hint text for the dropdown trigger.
final
- isGlassMode → bool
-
Whether to enable glassmorphism (blur background) for the dropdown panel.
final
- isLoadingMore → bool
-
Whether we are currently loading more items at the bottom.
final
- isMultiline → bool
-
Whether the selected label should wrap onto multiple lines.
final
- isMultiSelect → bool
-
Whether to allow multiple selections with recursive logic.
final
- itemBuilder → HierarchyItemBuilder?
-
Optional custom builder for each tree row.
final
- itemPadding → EdgeInsets?
-
Optional padding for each item row.
final
-
items
→ List<
HierarchyItem> -
The list of top-level hierarchy items.
final
- itemSpacing → double?
-
Vertical space between items.
final
- itemTextAlign → TextAlign?
-
Optional text alignment for the item title.
final
- itemTextStyle → TextStyle?
-
Optional custom text style for all items.
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- listPadding → EdgeInsets?
-
Optional padding for the overall list inside the dropdown.
final
- loadingIndicator → Widget?
-
Optional widget to show as a loader at the bottom of the list.
final
- maxHeight → double
-
Maximum height of the dropdown panel.
final
- offset → Offset?
-
Optional offset to position the dropdown panel relative to the trigger.
final
-
onChanged
→ ValueChanged<
String> -
Callback when the selection changes (comma-separated labels).
final
- onLoadMore → VoidCallback?
-
Callback when the user scrolls near the bottom of the list.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- searchBoxDecoration → BoxDecoration?
-
Optional custom decoration for the search field container.
final
- searchBuilder → HierarchySearchBuilder?
-
Optional custom builder for the search field.
final
- searchDecoration → InputDecoration?
-
Optional custom decoration for the default search field's InputDecoration.
final
- searchFocusNode → FocusNode?
-
Optional custom FocusNode for the search field.
final
- searchStyle → TextStyle?
-
Optional custom text style for the search field.
final
- showChips → bool
-
Whether to show selected items as chips in the header.
final
- showSearch → bool
-
Whether to show the search bar in the dropdown panel.
final
- targetAnchor → Alignment
-
Optional target anchor for the dropdown panel position.
final
- validator → String? Function(String?)?
-
Optional validator function to validate the selection.
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< HierarchySearchableDropdown> -
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, 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