ZeroDropdown<T>.icon constructor

ZeroDropdown<T>.icon({
  1. Key? key,
  2. required dynamic onChanged(
    1. dynamic
    ),
  3. required List<T> items,
  4. Widget? icon,
  5. double? size,
  6. double? dropdownWidth,
  7. T? value,
  8. Widget menuItemBuilder(
    1. T
    )?,
  9. Widget selectedMenuItemBuilder(
    1. T
    )?,
})

Constructor to create dropdown with only icon as the button. No Input Decoration needed

Implementation

factory ZeroDropdown.icon({
  Key? key,
  required Function(dynamic) onChanged,
  required List<T> items,
  Widget? icon,

  /// The dimension (widht and height) of the Icon. If null, it defaults to [TextfieldSize.small.height]
  double? size,
  double? dropdownWidth,
  T? value,
  Widget Function(T)? menuItemBuilder,
  Widget Function(T)? selectedMenuItemBuilder,
}) =>
    ZeroDropdown._(
      key: key,
      inputDecorationType: InputDecorationType.underline,
      onChanged: onChanged,
      items: items,
      enableMultipleItems: false,
      menuItemBuilder: menuItemBuilder,
      icon: icon,
      dropdownWidth: dropdownWidth,
      selectedMenuItemBuilder: selectedMenuItemBuilder,
      itemHeight: size ?? ZeroTextfieldSize.small.height,
      variant: DropdownVariant.icon,
    );