picker<T> method

T picker<T>(
  1. String name,
  2. Map<String, T> values,
  3. T defaultValue, {
  4. Color swatch(
    1. T value
    )?,
  5. IconData icon(
    1. T value
    )?,
  6. PickerStyle style = PickerStyle.dropdown,
})

A choice between named options, label to value.

swatch and icon put a colour dot or a glyph before each label on a catalog page. style is how the picker is drawn: a segmented control puts every option on show, for a choice like Light and Dark.

Implementation

T picker<T>(
  String name,
  Map<String, T> values,
  T defaultValue, {
  Color Function(T value)? swatch,
  IconData Function(T value)? icon,
  PickerStyle style = PickerStyle.dropdown,
}) {
  return defaultValue;
}