ExtendedDropdownButton<T> constructor
ExtendedDropdownButton<T> ({
- Key? key,
- required List<
DropdownMenuItem< ? items,T> > - DropdownButtonBuilder? selectedItemBuilder,
- T? value,
- Widget? hint,
- Widget? disabledHint,
- required ValueChanged<
T?> ? onChanged, - VoidCallback? onTap,
- int elevation = 8,
- TextStyle? style,
- Widget? underline,
- Widget? icon,
- Color? iconDisabledColor,
- Color? iconEnabledColor,
- double iconSize = 24.0,
- bool isDense = false,
- bool isExpanded = false,
- double? itemHeight = kMinInteractiveDimension,
- Color? focusColor,
- FocusNode? focusNode,
- bool autofocus = false,
- Color? dropdownColor,
- bool? enableFeedback,
- AlignmentGeometry alignment = AlignmentDirectional.centerStart,
- BorderRadius? borderRadius,
- bool useSafeArea = false,
- bool adjustRectToAvoidBottomInset = true,
- double? bottomViewInsetGetter(
- BuildContext context
- Rect? adjustButtonRect(
- BuildContext context,
- Rect buttonRect,
- double bottomViewInset
- FutureOr<
void> onTapBefore()?, - PositionArgument? underlinePosition,
Implementation
ExtendedDropdownButton({
Key? key,
required this.items,
this.selectedItemBuilder,
this.value,
this.hint,
this.disabledHint,
required this.onChanged,
this.onTap,
this.elevation = 8,
this.style,
this.underline,
this.icon,
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.dropdownColor,
this.menuMaxHeight,
this.enableFeedback,
this.alignment = AlignmentDirectional.centerStart,
this.borderRadius,
// When adding new arguments, consider adding similar arguments to
// DropdownButtonFormField.
// <<< The following fields are added by AoiHosizora
this.useRootNavigator = false,
this.useSafeArea = false,
this.adjustRectToAvoidBottomInset = true,
this.bottomViewInsetGetter,
this.adjustButtonRect,
this.onTapBefore,
this.underlinePosition,
}) : 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',
),
assert(itemHeight == null || itemHeight >= kMinInteractiveDimension),
super(key: key);