DropdownMenu<T> constructor

const DropdownMenu<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. TextInputType? keyboardType,
  15. TextStyle? textStyle,
  16. TextAlign textAlign = TextAlign.start,
  17. InputDecorationTheme? inputDecorationTheme,
  18. MenuStyle? menuStyle,
  19. TextEditingController? controller,
  20. T? initialSelection,
  21. ValueChanged<T?>? onSelected,
  22. FocusNode? focusNode,
  23. bool? requestFocusOnTap,
  24. EdgeInsetsGeometry? expandedInsets,
  25. FilterCallback<T>? filterCallback,
  26. SearchCallback<T>? searchCallback,
  27. Offset? alignmentOffset,
  28. required List<DropdownMenuEntry<T>> dropdownMenuEntries,
  29. 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 DropdownMenu({
  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.keyboardType,
  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,
  this.alignmentOffset,
  required this.dropdownMenuEntries,
  this.inputFormatters,
}) : assert(filterCallback == null || enableFilter);