Dropdown<T> constructor

const Dropdown<T>({
  1. Key? key,
  2. bool enabled = true,
  3. double? width,
  4. double? menuHeight,
  5. Widget? leadingIcon,
  6. Widget? trailingIcon,
  7. Widget? label,
  8. String? hintText,
  9. String? helperText,
  10. String? errorText,
  11. Widget? selectedTrailingIcon,
  12. bool enableFilter = false,
  13. bool enableSearch = true,
  14. TextStyle? textStyle,
  15. TextAlign textAlign = TextAlign.start,
  16. InputDecorationTheme? inputDecorationTheme,
  17. MenuStyle? menuStyle,
  18. DropdownTextController? controller,
  19. T? initialSelection,
  20. ValueChanged<T?>? onSelected,
  21. FocusNode? focusNode,
  22. bool? requestFocusOnTap,
  23. EdgeInsets? expandedInsets,
  24. FilterCallback<T>? filterCallback,
  25. SearchCallback<T>? searchCallback,
  26. required List<DropdownMenuEntry<T>> dropdownMenuEntries,
  27. List<TextInputFormatter>? inputFormatters,
})

Creates a const DropdownMenu.

The leading and trailing icons in the text field can be customized by using leadingIcon, trailingIcon and selectedTrailingIcon properties. They are passed down to the InputDecoration properties, and will override values in the InputDecoration.prefixIcon and InputDecoration.suffixIcon.

Except leading and trailing icons, the text field can be configured by the InputDecorationTheme property. The menu can be configured by the menuStyle.

Implementation

const Dropdown({
  super.key,
  this.enabled = true,
  this.width,
  this.menuHeight,
  this.leadingIcon,
  this.trailingIcon,
  this.label,
  this.hintText,
  this.helperText,
  this.errorText,
  this.selectedTrailingIcon,
  this.enableFilter = false,
  this.enableSearch = true,
  this.textStyle,
  this.textAlign = TextAlign.start,
  this.inputDecorationTheme,
  this.menuStyle,
  this.controller,
  this.initialSelection,
  this.onSelected,
  this.focusNode,
  this.requestFocusOnTap,
  this.expandedInsets,
  this.filterCallback,
  this.searchCallback,
  required this.dropdownMenuEntries,
  this.inputFormatters,
}) : assert(filterCallback == null || enableFilter);