DropdownButton2<T> constructor

DropdownButton2<T>({
  1. Key? key,
  2. required List<DropdownMenuItem<T>>? items,
  3. DropdownButtonBuilder? selectedItemBuilder,
  4. T? value,
  5. Widget? hint,
  6. Widget? disabledHint,
  7. ValueChanged<T?>? onChanged,
  8. int dropdownElevation = 8,
  9. TextStyle? style,
  10. Widget? underline,
  11. Widget? icon,
  12. Widget? iconOnClick,
  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. double? dropdownMaxHeight,
  23. bool? enableFeedback,
  24. AlignmentGeometry alignment = AlignmentDirectional.centerStart,
  25. double? buttonHeight,
  26. double? buttonWidth,
  27. EdgeInsetsGeometry? buttonPadding,
  28. BoxDecoration? buttonDecoration,
  29. int? buttonElevation,
  30. EdgeInsetsGeometry? itemPadding,
  31. double? dropdownWidth,
  32. EdgeInsetsGeometry? dropdownPadding,
  33. BoxDecoration? dropdownDecoration,
  34. Color? selectedItemHighlightColor,
  35. Radius? scrollbarRadius,
  36. double? scrollbarThickness,
  37. bool? scrollbarAlwaysShow,
  38. Offset? offset,
  39. Widget? customButton,
  40. List<int>? customItemsIndexes,
  41. double? customItemsHeight,
  42. bool openWithLongPress = false,
  43. bool dropdownOverButton = false,
  44. bool dropdownFullScreen = false,
  45. void onMenuStateChange(
    1. bool isOpen
    )?,
})

Implementation

DropdownButton2({
  Key? key,
  required this.items,
  this.selectedItemBuilder,
  this.value,
  this.hint,
  this.disabledHint,
  this.onChanged,
  this.dropdownElevation = 8,
  this.style,
  this.underline,
  this.icon,
  this.iconOnClick,
  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.dropdownMaxHeight,
  this.enableFeedback,
  this.alignment = AlignmentDirectional.centerStart,
  this.buttonHeight,
  this.buttonWidth,
  this.buttonPadding,
  this.buttonDecoration,
  this.buttonElevation,
  this.itemPadding,
  this.dropdownWidth,
  this.dropdownPadding,
  this.dropdownDecoration,
  this.selectedItemHighlightColor,
  this.scrollbarRadius,
  this.scrollbarThickness,
  this.scrollbarAlwaysShow,
  this.offset,
  this.customButton,
  this.customItemsIndexes,
  this.customItemsHeight,
  this.openWithLongPress = false,
  this.dropdownOverButton = false,
  this.dropdownFullScreen = false,
  this.onMenuStateChange,
  // When adding new arguments, consider adding similar arguments to
  // DropdownButtonFormField.
})  : assert(
items == null ||
    items.isEmpty ||
    value == null ||
    items.where((DropdownMenuItem<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',
),
      _inputDecoration = null,
      _isEmpty = false,
      super(key: key);