SearchableDropdownProvider<T> class

Inheritance

Constructors

SearchableDropdownProvider.new({required Future<List<DropDownModel<T>>>? asyncInitData, bool rememberSelectedValue = true, DropDownModel<T>? selectedValue, dynamic onOptionSelected(DropDownModel<T>?)?, Future<List<DropDownModel<T>>> onSearch(String searchText)?, double? selectorMaxHeight, List<DropDownModel<T>> initData = const [], String? validator(DropDownModel<T>?)?, required BuildContext context})

Properties

asyncInitData Future<List<DropDownModel<T>>>?
Future that provides the initial list of dropdown options.
finalinherited
asyncInitDataValue Future<void>
getter/setter pairinherited
baseSearchResults List<DropDownModel<T>>
finalinherited
context BuildContext
finalinherited
Gets the height of the dropdown suggestions list.
no setteroverride
finalinherited
no setter
fieldTapOutside bool
getter/setter pair
getDropdownData List<DropDownModel<T>>
no setter
hashCode int
The hash code for this object.
no setterinherited
hasListeners bool
Whether any listeners are currently registered.
no setterinherited
initData List<DropDownModel<T>>
The initial data set for the dropdown.
finalinherited
onOptionSelected → dynamic Function(DropDownModel<T>?)?
final
onSearch Future<List<DropDownModel<T>>> Function(String searchText)?
final
rememberSelectedValue bool
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
searchResults List<DropDownModel<T>>
no setter
searchTextController TextEditingController
A controller to manage the search input text for filtering the dropdown.
finalinherited
selectedValue DropDownModel<T>?
getter/setter pair
selectorMaxHeight double?
final
selectorTapOutside bool
getter/setter pair
setValidationError String?
Sets the validation error message and triggers a UI update.
no getterinherited
suggestionsExpanded bool
Whether the suggestions list is expanded or collapsed.
getter/setter pairinherited
textFieldFocusNode FocusNode
FocusNode for managing the text field's focus state.
getter/setter pairinherited
validationError String?
no setterinherited
validator String? Function(DropDownModel<T>?)?
Validator function that checks if a dropdown selection is valid.
finalinherited

Methods

addListener(VoidCallback listener) → void
Register a closure to be called when the object changes.
inherited
closeSuggestions() → void
Collapses the suggestions list in the dropdown.
override
dispose() → void
Discards any resources used by the object. After this is called, the object is not in a usable state and should be discarded (calls to addListener will throw after the object is disposed).
inherited
expandSuggestions({Widget? selectorWidget, bool expanded = true}) → void
Expands the suggestions list in the dropdown.
inherited
fieldBorderColor({Color? borderColor, Color? errorBorderColor}) Color
Returns the color to be used for the border of a form field, based on validation state.
inherited
getAsyncInitData() Future<void>
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
notifyListeners() → void
Call all the registered listeners.
inherited
onInputChanged(String text) → void
Triggers an update when the input text is changed.
override
onSelectSuggestion(DropDownModel<T>? value) → void
onTapOutside(BuildContext context) → void
onValidateField(dynamic text) String?
Validates the input field for the dropdown based on its current state.
override
removeListener(VoidCallback listener) → void
Remove a previously registered closure from the list of closures that are notified when the object changes.
inherited
toggleSuggestionsExpanded({Widget? selectorWidget, bool expanded = true}) → void
Toggles the state of the suggestions list between expanded and collapsed.
inherited
toString() String
A string representation of this object.
inherited
updateSelectorPositionIfNeeded({required Widget selectorWidget, bool expanded = true}) → void
Monitors and updates the position of the dropdown selector widget if needed.
inherited

Operators

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