Flutter Project with Custom Implementation of Drawer Menu

You are currently viewing Flutter Project with Custom Implementation of Drawer Menu
Zoom Drawer Menu

Flutter Project with Custom Implementation of Drawer Menu

Flutter Zoom Drawer

A Flutter package with custom implementation of the Side Menu (Drawer)

Getting Started

To start using this package, add flutter_zoom_drawer dependency to your pubspec.yaml

dependencies:
  flutter_zoom_drawer: '<latest_release>'

Features

  • Simple sliding drawer
  • Sliding drawer with shadows
  • Sliding drawer with rotation
  • Sliding drawer with rotation and shadows
  • Support for both LTR & RTL

Documentation

    ZoomDrawer(
      controller: ZoomDrawerController,
      style: DrawerStyle.DefaultStyle,
      menuScreen: MENU_SCREEN,
      mainScreen: MAIN_SCREEN,
      borderRadius: 24.0,
      showShadow: true,
      angle: -12.0,
      backgroundColor: Colors.grey[300],
      slideWidth: MediaQuery.of(context).size.width*.65,
      openCurve: Curves.fastOutSlowIn,
      closeCurve: Curves.bounceIn,
    )
ParametersValueRequiredDocs
controllerZoomDrawerControllerNoController to have access to the open/close/toggle function of the drawer
styleDrawerStyleNothe drawer style to be displayed (check the DrawerStyle enum)
mainScreenWidgetYesScreen containing the main content to display
menuScreenWidgetYesScreen containing the menu/bottom screen
slideWidthdoubleNoSliding width of the drawer – defaults to 275.0
mainScreenScaledoubleNoMainScreen scale – defaults to 0.3
borderRadiusdoubleNoBorder radius of the slided content – defaults to 16.0
angledoubleNoRotation angle of the drawer – defaults to -12.0 – should be 0.0 to -30.0
disableGestureboolNoDisable the home page swipe to open drawer gesture – defaults to false
backgroundColorColorNoBackground color of the drawer shadows – defaults to white
showShadowboolNoBoolean, whether to show the drawer shadows – defaults to false
isRtlboolNoBoolean, display the drawer in RTL
openCurveCurveNoopen animation curve – defaults to Curves.easeOut
closeCurveCurveNoclose animation curve – defaults to Curves.easeOut

Controlling the drawer

To get access to the drawer, and be able to control it, there are 2 ways:

  • Using a ZoomDrawerController inside the main widget where ou have the ZoomDrawer widget and providing it to the widget, which will allow you to trigger the open/close/toggle methods.
    final _drawerController = ZoomDrawerController();

    _drawerController.open();
    _drawerController.close();
    _drawerController.toggle();
    _drawerController.isOpen();
    _drawerController.stateNotifier;
  • Using the static method inside ancestor widgets to get access to the ZoomDrawer.
  ZoomDrawer.of(context).open();
  ZoomDrawer.of(context).close();
  ZoomDrawer.of(context).toggle();
  ZoomDrawer.of(context).isOpen();
  ZoomDrawer.of(context).stateNotifier;

Screens

  • Drawer Sliding
    ZoomDrawer(
      controller: ZoomDrawerController,
      menuScreen: MENU_SCREEN,
      mainScreen: MAIN_SCREEN,
      borderRadius: 24.0,
      showShadow: false,
      angle: 0.0,
      backgroundColor: Colors.grey[300],
      slideWidth: MediaQuery.of(context).size.width*(ZoomDrawer.isRTL()? .45: 0.65),
    )
  • Drawer Sliding with shadow
    ZoomDrawer(
      controller: ZoomDrawerController,
      menuScreen: MENU_SCREEN,
      mainScreen: MAIN_SCREEN,
      borderRadius: 24.0,
      showShadow: true,
      angle: 0.0,
      backgroundColor: Colors.grey[300],
      slideWidth: MediaQuery.of(context).size.width*(ZoomDrawer.isRTL()? .45: 0.65),
    )
  • Drawer Sliding with rotation
    ZoomDrawer(
      controller: ZoomDrawerController,
      menuScreen: MENU_SCREEN,
      mainScreen: MAIN_SCREEN,
      borderRadius: 24.0,
      showShadow: false,
      angle: -12.0,
      backgroundColor: Colors.grey[300],
      slideWidth: MediaQuery.of(context).size.width*(ZoomDrawer.isRTL()? .45: 0.65),
    )
  • Drawer Sliding with rotation and shadows
    ZoomDrawer(
      controller: ZoomDrawerController,
      menuScreen: MENU_SCREEN,
      mainScreen: MAIN_SCREEN,
      borderRadius: 24.0,
      showShadow: true,
      angle: -12.0,
      backgroundColor: Colors.grey[300],
      slideWidth: MediaQuery.of(context).size.width*(ZoomDrawer.isRTL()? .45: 0.65),
    )

Issues

Please file any issues, bugs or feature request as an issue on our GitHub page.

See also  Bungee Music Player in Flutter

Credits:
This is developed by medyas
Download this project from the below link.
https://github.com/medyas/flutter_zoom_drawer/archive/refs/heads/master.zip
You can visit original source page from the below link:
https://github.com/medyas/flutter_zoom_drawer

Spread the love

Leave a Reply