NavigationMenuItem constructor
const
NavigationMenuItem({
- Key? key,
- VoidCallback? onPressed,
- Widget? content,
- required Widget child,
Creates a NavigationMenuItem with the specified properties.
The child
parameter is required as it provides the visible
content for the menu item. Either onPressed
or content
should be provided to make the item interactive.
Parameters:
onPressed
(VoidCallback?, optional): Action when item is pressedcontent
(Widget?, optional): Content for navigation popoverchild
(Widget, required): The visible menu item content
Example:
NavigationMenuItem(
onPressed: _handleNavigation,
child: Row(
children: [Icon(Icons.home), Text('Home')],
),
)
Implementation
const NavigationMenuItem(
{super.key, this.onPressed, this.content, required this.child});