ofMap<K, V> static method

KeyedOptionsHandler<K, V> ofMap<K, V>(
  1. dynamic key, {
  2. String? placeholder,
  3. Icon? inputIcon,
  4. required bool canShowAll,
  5. bool? showImmediateOptions,
  6. required Map<K, V> allOptions,
  7. required Mapping<V?, KeyedOption<K, V>?> toOption,
  8. required Mapping<V, K?> toKey,
  9. 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),
  );
}