BaseDropdownProvider<T> class abstract

Abstract base class to manage the state and behavior of a dropdown widget.

This class defines an interface for handling suggestions visibility, input validation, and dropdown UI behavior. Concrete implementations should extend this class and provide the necessary functionality.

Mixed-in types
Implementers

Constructors

BaseDropdownProvider.new({List<DropDownModel<T>> initData = const [], Future<List<DropDownModel<T>>>? asyncInitData, String? validator(DropDownModel<T>?)?, required BuildContext context})
Creates a new BaseDropdownProvider instance.

Properties

asyncInitData Future<List<DropDownModel<T>>>?
Future that provides the initial list of dropdown options.
final
asyncInitDataValue Future<void>
getter/setter pair
baseSearchResults List<DropDownModel<T>>
final
context BuildContext
final
Gets the height of the dropdown suggestions list.
no setter
final
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.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
searchTextController TextEditingController
A controller to manage the search input text for filtering the dropdown.
final
setValidationError String?
Sets the validation error message and triggers a UI update.
no getter
suggestionsExpanded bool
Whether the suggestions list is expanded or collapsed.
getter/setter pair
textFieldFocusNode FocusNode
FocusNode for managing the text field's focus state.
getter/setter pair
validationError String?
no setter
validator String? Function(DropDownModel<T>?)?
Validator function that checks if a dropdown selection is valid.
final

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.
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.
fieldBorderColor({Color? borderColor, Color? errorBorderColor}) Color
Returns the color to be used for the border of a form field, based on validation state.
getAsyncInitData() Future<void>
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.
onValidateField(dynamic text) String?
Validates the input field for the dropdown based on its current state.
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.
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.

Operators

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