KeyedOptionsHandler<K, T> class
abstract
A base interface for helping to populate drop-downs and typeaheads. There are a couple of common mixins to cut down on boilerplate:
InMemorySearchOptionsMixin If you have a list of static options and then want to apply in-memory filtering, use the AlwaysFilterSearchOptionsMixin If you always filter results, and want to force your listAllOptions to just execute a blank search
- Implementers
- Available Extensions
Constructors
- KeyedOptionsHandler(Object? key)
- KeyedOptionsHandler.ofString(String key)
-
const
Properties
-
adhocOptionBuilder
→ KeyedAdhocBuilder<
K, T> ? -
no setter
- canShowAll → bool
-
Whether or not its reasonable to display all options (or at least the first few), without any query input from
the user.
no setteroverride
- hashCode → int
-
The hash code for this object.
no setterinherited
- key → String
-
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
cast<
KK, VV> () → IKeyedOptionsHandler< KK, VV> -
inherited
-
castList(
List input) → List< K> - Casts a list of inputs as this type
-
filter(
String? query, List currentSelections, int limit) → FutureOr< List< T> > - Filters the list of all options based on a query - the list of current selections is also provided.
-
listAllOptions(
[int? limit]) → FutureOr< List< T> > - A list of all options.
-
loadValue(
K key) → FutureOr< T?> -
Loads a value given a key - because some options can be suggestive type-aheads, consumers should use
StringOptionsHandlerExtension.resolveOption
andStringOptionsHandlerExtension.resolveAllOptions
override -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toKey(
T value) → K? - Produces a key, given a value
-
toOption(
T? value) → KeyedOption< K, T> ? -
Converts a value
T
to aKeyedOption
-
toString(
) → String -
A string representation of this object.
inherited
-
withMetaContext(
IMetaFormFieldContext context) → KeyedOptionsHandler< K, T> - Creates a copy of this handler, for hte provided context. Sometimes the behavior of options will change based on the surrounding context.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited