SideMenu provides access to destinations in the app from an easy to access menu which is accessible to the user via horizontal swipe gesture or a menu button.
To open the side menu programmatically, you'll need to update the visible property of the side menu you'd like to open.
The following snippet shows how to open the left side menu. The menu is opened by setting its visible option to visible.
Opening via the hamburger menu
The most common use case is to open the side menu by pressing the hamburger button at the TopBar. To achieve this, listen to the press event of the burger button, and open the side menu as shown above.
Pushing to the center layout from a menu
A common use case when using SideMenus is to interact with the center layout, e.g. pushing a screen to a stack in the center layout when a user clicks on a button from one of the menus.
In order to interact with the stack, we'll first assign it a predefined id. For example:
Now that we've defined an
id for out stack, we can go ahead and push our screen to it. If we're pushing while the SideMenu is open, we'll need to make sure we close it by updating the visibility option of the relevant menu (left or right).