DropdownState<T extends Object> class
- Inheritance
-
- Object
- ChangeNotifier
- DropdownState
- Implemented types
Constructors
-
DropdownState({List<
T> items = const [], required Future<(List< asyncSearchCallback({Map<T> , Object?)>String, dynamic> ? orderBy, int? page, int? perPage, Map<String, dynamic> ? searchBy})?, required Future<List< syncSearchCallback(String)?, required BuildContext context, required Widget itemBuilder(BuildContext, T), required bool isMultiple, required String valueToShow(T), required List<T> >T> previousSelectedItems, required dynamic onSelectItems(List<T> )?, required dynamic onSelectItem(T?)?, required FocusNode focusNode, required int perPage, required String? searchColumn, dynamic onClearItem()?, String? hint, bool isCompact = true})
Properties
-
asyncSearchCallback
→ Future<
(List< Function({Map<T> , Object?)>String, dynamic> ? orderBy, int? page, int? perPage, Map<String, dynamic> ? searchBy})? -
final
- context → BuildContext
-
final
- focusNode → FocusNode
-
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- hasListeners → bool
-
Whether any listeners are currently registered.
no setterinherited
- hint → String?
-
The hint text for this dropdown — used as key in CLDropdownRegistry.
final
- isCompact → bool
-
Se
true, item del menu più densi (padding verticale ridotto).final - isMultiple → bool
-
final
- isOverlayOpen ↔ bool
-
getter/setter pair
- itemBuilder → Widget Function(BuildContext, T)
-
final
-
items
↔ List<
T> -
getter/setter pair
- layerLink → LayerLink
-
final
- loading ↔ bool
-
getter/setter pair
- onClearItem → dynamic Function()?
-
final
- onSelectItem → dynamic Function(T?)?
-
final
-
onSelectItems
→ dynamic Function(List<
T> )? -
final
- perPage ↔ int
-
getter/setter pair
-
previousSelectedItems
→ List<
T> -
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- searchColumn → String?
-
final
- searchQuery ↔ String
-
Query corrente digitata nel campo trigger. Distinta dal testo del
controller (che può mostrare la label dell'elemento selezionato): viene
valorizzata solo dall'input utente via onSearch e usata per il paging.
getter/setter pair
- selectedItem ↔ T?
-
getter/setter pair
-
selectedItems
↔ List<
T> -
getter/setter pair
-
syncSearchCallback
→ Future<
List< Function(String)?T> > -
final
- textEditingController → TextEditingController
-
final
-
textFormFieldKey
↔ GlobalKey<
State< StatefulWidget> > -
getter/setter pair
- valueToShow → String Function(T)
-
final
Methods
-
addListener(
VoidCallback listener) → void -
Register a closure to be called when the object changes.
inherited
-
clearAll(
) → void -
closeOverlay(
) → void -
dispose(
) → void -
Discards any resources used by the object.
override
-
handleKey(
FocusNode node, KeyEvent event) → KeyEventResult -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
notifyListeners(
) → void -
Call all the registered listeners.
inherited
-
onSearch(
String? searchColumn, String query) → Future< void> -
onTriggerChanged(
String value) → void - Invocata dall'input utente nel campo trigger: registra la query, apre l'overlay se chiuso e avvia la ricerca (debounced per l'async).
-
openOverlay(
) → void -
removeItem(
T item) → void -
removeListener(
VoidCallback listener) → void -
Remove a previously registered closure from the list of closures that are
notified when the object changes.
inherited
-
selectByName(
String name) → Future< bool> -
Programmatically selects an item matching
name. For async dropdowns: does a targeted API search by name first (large page), then falls back to the already-loaded items list. For sync dropdowns: searches the provided items list. Returns true if an item was found and selected.override -
syncExternalSelectedItems(
List< T> externalSelectedItems) → void - Sincronizza lo stato interno con eventuali aggiornamenti esterni (es. selectedValues valorizzati dopo un preload asincrono).
-
toggleOverlay(
) → void -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited