CustomDropdownButton<T> constructor

CustomDropdownButton<T>({
  1. Key? key,
  2. required List<CustomDropdownMenuItem<T>>? items,
  3. DropdownButtonBuilder? selectedItemBuilder,
  4. T? value,
  5. Widget? hint,
  6. Widget? disabledHint,
  7. ValueChanged<T?>? onChanged,
  8. VoidCallback? onTap,
  9. int elevation = 8,
  10. TextStyle? style,
  11. Widget? underline,
  12. Widget? icon,
  13. Color? iconDisabledColor,
  14. Color? iconEnabledColor,
  15. double iconSize = 24.0,
  16. bool isDense = false,
  17. bool isExpanded = false,
  18. double? itemHeight = kMinInteractiveDimension,
  19. Color? focusColor,
  20. FocusNode? focusNode,
  21. bool autofocus = false,
  22. Color? dropdownColor,
  23. double? menuMaxHeight,
  24. required DropdownMenuDirection menuDirection,
})

Implementation

CustomDropdownButton({
  Key? key,
  required this.items,
  this.selectedItemBuilder,
  this.value,
  this.hint,
  this.disabledHint,
  this.onChanged,
  this.onTap,
  this.elevation = 8,
  this.style,
  this.underline,
  this.icon,
  this.iconDisabledColor,
  this.iconEnabledColor,
  this.iconSize = 24.0,
  this.isDense = false,
  this.isExpanded = false,
  this.itemHeight = kMinInteractiveDimension,
  this.focusColor,
  this.focusNode,
  this.autofocus = false,
  this.dropdownColor,
  this.menuMaxHeight,
  required this.menuDirection,
})  : assert(
        items == null ||
            items.isEmpty ||
            value == null ||
            items.where((CustomDropdownMenuItem<T> item) {
                  return item.value == value;
                }).length ==
                1,
        "There should be exactly one item with [DropdownButton]'s value: "
        '$value. \n'
        'Either zero or 2 or more [DropdownMenuItem]s were detected '
        'with the same value',
      ),
      assert(itemHeight == null || itemHeight >= kMinInteractiveDimension),
      super(key: key);