MenuButton<T> constructor

const MenuButton<T>({
  1. required Widget child,
  2. required List<T> items,
  3. required MenuItemBuilder<T> itemBuilder,
  4. Widget? toggledChild,
  5. Widget divider = const Divider(height: 1, color: Colors.grey),
  6. bool topDivider = true,
  7. MenuItemSelected<T>? onItemSelected,
  8. BoxDecoration? decoration,
  9. MenuButtonToggleCallback? onMenuButtonToggle,
  10. ScrollPhysics scrollPhysics = const NeverScrollableScrollPhysics(),
  11. double? popupHeight,
  12. bool crossTheEdge = false,
  13. double edgeMargin = 0.0,
  14. bool showSelectedItemOnList = true,
  15. T? selectedItem,
  16. Text? label,
  17. LabelDecoration? labelDecoration,
  18. Color itemBackgroundColor = Colors.white,
  19. Color menuButtonBackgroundColor = 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.itemBackgroundColor = Colors.white,
    final this.menuButtonBackgroundColor = Colors.white})
    : assert(showSelectedItemOnList || selectedItem != null);