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. TextStyle? textStyle,
  15. InputDecorationTheme? inputDecorationTheme,
  16. MenuStyle? menuStyle,
  17. TextEditingController? controller,
  18. T? initialSelection,
  19. ValueChanged<T?>? onSelected,
  20. bool? requestFocusOnTap,
  21. EdgeInsets? expandedInsets,
  22. SearchCallback<T>? searchCallback,
  23. required List<DropdownMenuEntry<T>> dropdownMenuEntries}
)

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.textStyle,
  this.inputDecorationTheme,
  this.menuStyle,
  this.controller,
  this.initialSelection,
  this.onSelected,
  this.requestFocusOnTap,
  this.expandedInsets,
  this.searchCallback,
  required this.dropdownMenuEntries,
});