SideMenu constructor
const
SideMenu({
- Key? key,
- required Widget child,
- required Color? background,
- required BorderRadius? radius,
- Icon? closeIcon = const Icon(Icons.close, color: const Color(0xFFFFFFFF)),
- SideMenuType type = SideMenuType.shrikNRotate,
- double maxMenuWidth = 275.0,
- bool inverse = false,
Liquid Shrink Side Menu is compatible with Liquid ui
Create a SideMenu / Drawer
final GlobalKey<SideMenuState> _sideMenuKey = GlobalKey<SideMenuState>();
SideMenu(
key: _sideMenuKey, // to toggle this sidemenu
menu: buildMenu(),
type: SideMenuType.slideNRotate, // check above images
child: Scaffold(
appBar: AppBar(
leading: IconButton(
icon: Icon(Icons.menu),
onPressed: () {
final _state = _sideMenuKey.currentState;
if (_state.isOpened)
_state.closeDrawer(); // close side menu
else
_state.openDrawer();// open side menu
},
),
...
),
);
Set inverse
equals true
to create end sidemenu
Implementation
const SideMenu({
Key? key,
required this.child,
required this.background,
required this.radius,
this.closeIcon = const Icon(
Icons.close,
color: const Color(0xFFFFFFFF),
),
required this.menu,
this.type = SideMenuType.shrikNRotate,
this.maxMenuWidth = 275.0,
bool inverse = false,
}) : assert(maxMenuWidth > 0),
_inverse = inverse ? -1 : 1,
super(key: key);