OptionsHandler<T> class
abstract
A base class for helping to populate drop-downs and typeaheads.
This class works with models and tries to remain free of view concerns, but the Option
class does track title,
subtitle, and selection.
- Inheritance
-
- Object
- KeyedOptionsHandler<
T, T> - OptionsHandler
- Implementers
- Available Extensions
Constructors
- OptionsHandler(dynamic key)
-
OptionsHandler.ofList(dynamic key, {String? placeholder, Icon? inputIcon, required bool canShowAll, List<
T> ? allOptions, Mapping<T?, Option< ? toOption, AdhocBuilder<T> ?>T> ? adhocOptionsBuilder}) -
factory
Properties
-
adhocOptionBuilder
→ KeyedAdhocBuilder<
T, T> ? -
no setterinherited
- 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 setterinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- key → String
-
finalinherited
- 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< T> -
Casts a list of inputs as this type
inherited
-
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.
inherited
-
listAllOptions(
[int? limit]) → FutureOr< List< T> > -
A list of all options.
inherited
-
loadValue(
T key) → 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) → T? -
Produces a key, given a value
inherited
-
toOption(
T? value) → Option< T> ? -
Converts a value
T
to aKeyedOption
override -
toString(
) → String -
A string representation of this object.
inherited
-
withMetaContext(
IMetaFormFieldContext context) → OptionsHandler< T> -
Creates a copy of this handler, for hte provided context. Sometimes the behavior of options will change
based on the surrounding context.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
ofEnum<
T extends MLiteral< (String> >String key, {String? placeholder}) → OptionsHandler< T> -
ofMap<
K, V> (dynamic key, {String? placeholder, Icon? inputIcon, required bool canShowAll, bool? showImmediateOptions, required Map< K, V> allOptions, required Mapping<V?, KeyedOption< toOption, required Mapping<K, V> ?>V, K?> toKey, KeyedAdhocBuilder<K, V> ? adhocOptionBuilder}) → KeyedOptionsHandler<K, V> -
ofProperty(
IMSchemaProperty prop, {String placeholder = "Enter an option", List< String> ? allOptions, required bool allowAdHoc}) → OptionsHandler<String>