MenuButton<T> constructor
const
MenuButton<T> ({
- required Widget child,
- required List<
T> items, - required MenuItemBuilder<
T> itemBuilder, - Widget? toggledChild,
- Widget divider = const Divider(height: 1, color: Colors.grey),
- bool topDivider = true,
- MenuItemSelected<
T> ? onItemSelected, - BoxDecoration? decoration,
- MenuButtonToggleCallback? onMenuButtonToggle,
- ScrollPhysics scrollPhysics = const NeverScrollableScrollPhysics(),
- double? popupHeight,
- bool crossTheEdge = false,
- double edgeMargin = 0.0,
- bool showSelectedItemOnList = true,
- T? selectedItem,
- Text? label,
- LabelDecoration? labelDecoration,
- Color? highlightColor,
- Color itemBackgroundColor = Colors.white,
Implementation
const MenuButton(
{required final this.child,
required final this.items,
required final this.itemBuilder,
final this.toggledChild,
final this.divider = const Divider(
height: 1,
color: Colors.grey,
),
final this.topDivider = true,
final this.onItemSelected,
final this.decoration,
final this.onMenuButtonToggle,
final this.scrollPhysics = const NeverScrollableScrollPhysics(),
final this.popupHeight,
final this.crossTheEdge = false,
final this.edgeMargin = 0.0,
final this.showSelectedItemOnList = true,
final this.selectedItem,
final this.label,
final this.labelDecoration,
final this.highlightColor,
final this.itemBackgroundColor = Colors.white,
final this.menuButtonBackgroundColor = Colors.white})
: assert(showSelectedItemOnList || selectedItem != null);