DropdownMenu<T> constructor
- Key? key,
- bool enabled = true,
- double? width,
- Widget? leadingIcon,
- Widget? trailingIcon,
- Widget? label,
- String? hintText,
- String? helperText,
- String? errorText,
- Widget? selectedTrailingIcon,
- bool enableFilter = false,
- bool enableSearch = true,
- TextStyle? textStyle,
- TextAlign textAlign = TextAlign.start,
- InputDecorationTheme? inputDecorationTheme,
- TextEditingController? controller,
- T? initialSelection,
- ValueChanged<
T?> ? onSelected, - FocusNode? focusNode,
- bool? requestFocusOnTap,
- EdgeInsets? expandedInsets,
- FilterCallback<
T> ? filterCallback, - SearchCallback<
T> ? searchCallback, - required List<
DropdownMenuEntry< dropdownMenuEntries,T> > - 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.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);