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

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
cast() → KeyedOptionsHandler<K, V>

Available on IKeyedOptionsHandler<K, V>, provided by the IKeyedOptionHandlerCast extension

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 and StringOptionsHandlerExtension.resolveAllOptions
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
resolveAllOptions(BuildContext context, Iterable<K>? inputs) → List<FutureOr<KeyedOption<K, T>?>?>

Available on KeyedOptionsHandler<K, T>, provided by the OptionsHandlerExtension extension

resolveOption(K? key) → FutureOr<KeyedOption<K, T>?>

Available on KeyedOptionsHandler<K, T>, provided by the OptionsHandlerExtension extension

Given a key key, this will attempt to resolve it either by: a) loading the value using loadValue b) creating an ad-hoc option
toKey(T value) → K?
Produces a key, given a value
toOption(T? value) → KeyedOption<K, T>?
Converts a value T to a KeyedOption
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