Easy sidemenu is An easy to use side menu (bar) for flutter that you can use for navigations in your application.
Sidemenu is a menu that is usually located on the left or right of the page and can used for navigations or other things. Sidemenu is similar to bottom navigation bar but in the side of screen and usually used for larger screens.
Screenshots
Open | Compact |
---|---|
Auto |
---|
Demo
You can see web demo here: https://jamalianpour.github.io/easy_sidemenu
Usage
1. add dependencies into you project pubspec.yaml file
dependencies:
easy_sidemenu: ^0.1.1+1
Run flutter packages get
in the root directory of your app.
2. import easy sidemenu lib
import 'package:easy_sidemenu/easy_sidemenu.dart';
Now you can use SideMenu
as a widget in your code.
3. use SideMenu
At first you should defind a list of item that will displayed on SideMenu
:
<div class=”highlight highlight-source-dart position-relative” data-snippet-clipboard-copy-content=”List items = [
SideMenuItem(
// Priority of item to show on SideMenu, lower value is displayed at the top
priority: 0,
title: ‘Dashboard’,
onTap: () => page.jumpToPage(0),
icon: Icons.home,
),
SideMenuItem(
priority: 1,
title: ‘Settings’,
onTap: () => page.jumpToPage(1),
icon: Icons.settings,
),
SideMenuItem(
priority: 2,
title: ‘Exit’,
onTap: () {},
icon: Icons.exit_to_app,
),
];
“>
List<SideMenuItem> items = [ SideMenuItem( // Priority of item to show on SideMenu, lower value is displayed at the top priority: 0, title: 'Dashboard', onTap: () => page.jumpToPage(0), icon: Icons.home, ), SideMenuItem( priority: 1, title: 'Settings', onTap: () => page.jumpToPage(1), icon: Icons.settings, ), SideMenuItem( priority: 2, title: 'Exit', onTap: () {}, icon: Icons.exit_to_app, ), ];