ofMap<K, V> static method
KeyedOptionsHandler<K, V>
ofMap<
K, V>( - dynamic key, {
- String? placeholder,
- Icon? inputIcon,
- required bool canShowAll,
- bool? showImmediateOptions,
- required Map<K, V> allOptions,
- required Mapping<V?, KeyedOption<K, V>?> toOption,
- required Mapping<V, K?> toKey,
- KeyedAdhocBuilder<K, V>? adhocOptionBuilder,
})
Implementation
static KeyedOptionsHandler<K, V> ofMap<K, V>(
key, {
String? placeholder,
Icon? inputIcon,
required bool canShowAll,
bool? showImmediateOptions,
required Map<K, V> allOptions,
required Mapping<V?, KeyedOption<K, V>?> toOption,
required Mapping<V, K?> toKey,
KeyedAdhocBuilder<K, V>? adhocOptionBuilder,
}) {
return _KeyedOptionsHandler<K, V>(
key,
adhocOptionBuilder: adhocOptionBuilder,
showImmediateOptions: showImmediateOptions ?? canShowAll,
placeholder: placeholder,
inputIcon: inputIcon,
canShowAll: canShowAll,
allOptionsMap: {...allOptions},
toKey: toKey,
toOption: (V? value) => toOption(value),
);
}