BarButton constructor Null safety
- {required Widget text,
A BarButton is displayed as a button in the bar.
The following 2 fields are necessary: text
and submenu
.
Assign a widget to the text
field. This text is displayed as the button text, for example "File", "Edit", "Help", etc.
Assign a SubMenu to the submenu
field. This submenu is the menu that is opened on when tapping this button.
You can style the BarButton widgets in the barButtonStyle
field of your MenuBarWidget.
Implementation
const BarButton({
required Widget text,
required SubMenu submenu,
}) : super(
menuEntryType: MenuEntryType.BarButton,
text: text,
submenu: submenu,
);