A Flutter package with custom implementation of Drawer

Overview

Flutter Zoom Drawer

pub package License: MIT

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,
    )
Parameters Value Required Docs
controller ZoomDrawerController No Controller to have access to the open/close/toggle function of the drawer
style DrawerStyle No the drawer style to be displayed (check the DrawerStyle enum)
mainScreen Widget Yes Screen containing the main content to display
menuScreen Widget Yes Screen containing the menu/bottom screen
slideWidth double No Sliding width of the drawer - defaults to 275.0
mainScreenScale double No MainScreen scale - defaults to 0.3
borderRadius double No Border radius of the slided content - defaults to 16.0
angle double No Rotation angle of the drawer - defaults to -12.0 - should be 0.0 to -30.0
disableGesture bool No Disable the home page swipe to open drawer gesture - defaults to false
backgroundColor Color No Background color of the drawer shadows - defaults to white
showShadow bool No Boolean, whether to show the drawer shadows - defaults to false
isRtl bool No Boolean, display the drawer in RTL
openCurve Curve No open animation curve - defaults to Curves.easeOut
closeCurve Curve No close 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

Example app Demo

Example RTL Demo

  • 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

  • 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

  • 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

  • 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),
    )

Drawer Sliding with rotation and shadows

Issues

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

Want to contribute

If you would like to contribute to the plugin (e.g. by improving the documentation, solving a bug or adding a cool new feature), please carefully review our contribution guide and send us your pull request.

Credits

Credits goes to pedromassango as most of this package comes from his implementation.

Comments
  • rotation not working

    rotation not working

    Hi, I recently use your package and face this weird issue that no matter what number I put for angle rotate value (between 0 to -30.0), it's not working...

    opened by shadycyan 20
  • Operand of null-aware operation '!' has type 'Locale' which excludes null.

    Operand of null-aware operation '!' has type 'Locale' which excludes null.

    [+2159 ms] /C:/src/Flutter/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_zoom_drawer-2.0.2+4/lib/flutter_zoom_drawer.dart:117:24:
    Warning: Operand of null-aware operation '!' has type 'Locale' which excludes null.
    [   +2 ms]  - 'Locale' is from 'dart:ui'.
    [        ]       return ui.window.locale!.languageCode.toLowerCase();
    [        ]                        ^
    
    opened by mpeswani 18
  • main screen reload state when drawer get closed

    main screen reload state when drawer get closed

    Is it normal that main screen reload state whenever drawer get closed ?

    [✓] Flutter (Channel stable, 2.10.0, on macOS 12.2 21D49 darwin-x64, locale en-SA)
        • Flutter version 2.10.0 at /Users/amr/Developer/flutter
        • Upstream repository https://github.com/flutter/flutter.git
        • Framework revision 5f105a6ca7 (7 days ago), 2022-02-01 14:15:42 -0800
        • Engine revision 776efd2034
        • Dart version 2.16.0
        • DevTools version 2.9.2
    
    [✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
        • Android SDK at /Users/Amr/Library/Android/sdk
        • Platform android-31, build-tools 31.0.0
        • Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
        • Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7281165)
        • All Android licenses accepted.
    
    [✓] Xcode - develop for iOS and macOS (Xcode 13.1)
        • Xcode at /Applications/Xcode.app/Contents/Developer
        • CocoaPods version 1.11.2
    
    [✓] Android Studio (version 2020.3)
        • Android Studio at /Applications/Android Studio.app/Contents
        • Flutter plugin can be installed from:
          🔨 https://plugins.jetbrains.com/plugin/9212-flutter
        • Dart plugin can be installed from:
          🔨 https://plugins.jetbrains.com/plugin/6351-dart
        • Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7281165)
    
    [✓] Connected device (2 available)
        • iPhone 13 Pro Max (mobile) • BF39C4C7-23EB-4AE8-96CE-5249244310DB • ios • com.apple.CoreSimulator.SimRuntime.iOS-15-0 (simulator)
        • iPhone 13 mini (mobile)    • 93EEE2FE-6E34-4237-85D2-100A2FA3BAA8 • ios • com.apple.CoreSimulator.SimRuntime.iOS-15-0 (simulator)
    
    [✓] HTTP Host Availability
        • All required HTTP hosts are available
    
    • No issues found!
    
    

    using flutter_zoom_drawer: ^2.3.0

    opened by Amr1440 14
  • RTL problem

    RTL problem

    Hi. When I set RTL to true then at the start of the screen the drawer is open for one second and then it close. This happens only in RTL mode. My app Locale is "fa" and my device language is English. It happens in your last update.

    opened by Tokenizer94 14
  • landscape mode have area error overflow

    landscape mode have area error overflow

    hi , i just implement this package on project everything works fine , but it has a small problem on landscape mode have area error overflow like picture below , i try to wrap it with SingleChildScrollView but it still doesn't work , how can i fix this problem ? thank in advance Simulator Screen Shot - iPhone 12 Pro Max - 2021-09-03 at 16 17 41

    opened by YouSour 8
  • Previous version 2.2.1 saves page state while current version (2.2.2) don't

    Previous version 2.2.1 saves page state while current version (2.2.2) don't

    While testing the new version, I realized that, unlike the previous version (2.2.1) the page state in the current version(2.2.2) is not saved when menu is open.

    Compare this two shots and observe the change in color on the main screen when the menu is open.

    For Version 2.2.2. Here Page State is not saved. https://user-images.githubusercontent.com/40724883/150238815-ad398332-6999-47af-8918-4c92594d214a.mp4

    For Version 2.2.1. Here Page state is saved. https://user-images.githubusercontent.com/40724883/150238912-cbf74b70-b7db-4f2f-ba39-19239a14e391.mp4

    opened by Princewil 7
  • all is working fine. But i have this warning

    all is working fine. But i have this warning

    /C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_zoom_drawer-2.0.2+1/lib/flutter_zoom_drawer.dart:106:30: Warning: Operand of null-aware operation '!' has type 'Locale' which excludes null.

    • 'Locale' is from 'dart:ui'. final locale = ui.window.locale!.languageCode.toLowerCase();
    opened by zneti-sourour 5
  • Improvement: Slide back menu when opened

    Improvement: Slide back menu when opened

    Hi. Thanks for your package, really nice job.

    However, I would like to know if it is possible to close the drawer when its opened, by swiping or clicking the view on the right.

    Thanks in advance

    opened by houdayec 5
  • Disable taps on content elements

    Disable taps on content elements

    Thanks for this great flutter menu! I'm wondering how you would disable taps on the content page while the menu is open. I experienced some problems with buttons on the content page being tappable while the menu is open and I would like to deactivate them if the drawer is visible. Thanks!

    opened by alibasta 5
  • Add ability to know if the drawer is opened or closed

    Add ability to know if the drawer is opened or closed

    I'm currently working with this plugin (pretty great, btw) but I see is lacking the ability to know if the drawer is opened or closed. I think this is a very important feature to this plugin. I guess this could be implemented in the ZoomDrawerController.

    When I have a little more free time I can work on this if you can't

    opened by ElZombieIsra 5
  • Close drawer on click - Feature request

    Close drawer on click - Feature request

    I kindly would like to raise a feature request where we can close drawer by only clicking on the widget instead of only swiping.

    I tested my app and many users didn't figure out how to close the drawer.

    My current workaround:

    GestureDetector(
        onTap: () {
          if (ZoomDrawer.of(context)?.isOpen() == true) {
            ZoomDrawer.of(context)?.close();
          }
        },
        child: myWidget,
    );
    

    Thanks!

    opened by YDA93 4
  • Slide to open doesn't work when main screen has horizontal view pager

    Slide to open doesn't work when main screen has horizontal view pager

    To reproduce, use example code part of this project:

    https://raw.githubusercontent.com/medyas/flutter_zoom_drawer/master/example/lib/main.dart

    user can't swipe to open zoom drawer from main screen, it appears TabBarView blocks the swipe event from reaching GestureDetector in Zoom Drawer

    opened by mingqlin 1
  • Remove space between menu and drawer

    Remove space between menu and drawer

    image

    Hi,

    I've been trying to remove the space between the drawer and Menu... because I need to apply different color styling. Is this possible with the package? If so, how can I? Thanks

    opened by Kennexcorp 3
  • Shrinks everything 50 percent after navigating

    Shrinks everything 50 percent after navigating

    Plugin works fine, i set my menu items and their routes. But when i navigate one of my page, every other pages get shrinked about 50 percent. All my app changes. Im using sizer package on my app. I realise when set my size values with sizer, it happens. But if i dont set values and just use flex this does not happen.

    opened by Ghost562562 1
  • Migrate to classes instead of function widgets

    Migrate to classes instead of function widgets

    Using function widgets is not recommended by flutter.

    References

    According to https://www.youtube.com/watch?v=IOyq-eTRhvo , this affects Performance, Testability, and Accuracy

    https://stackoverflow.com/questions/53234825/what-is-the-difference-between-functions-and-classes-to-create-widgets/53234826#53234826

    https://github.com/flutter/flutter/issues/19269

    How should this be fixed?

    I would recommend this package as start point.

    https://github.com/rrousselGit/functional_widget

    enhancement 
    opened by YDA93 0
Owner
Mobile Developer - Certified Associate Android Developer
null
Dart GraphQL server implementation. Utilities, code generator, examples and reference implementation.

Leto - GraphQL Server A complete implementation of the official GraphQL specification in the Dart programming language. Inspired by graphql-js, async-

Juan Manuel Castillo 29 Nov 27, 2022
Best ever drawer in flutter for android and ios

Drawer in Flutter Best ever drawer in flutter to make precious application. This flutter app is made just to demonstrate how you we can make an animat

Asad Malik 22 Oct 16, 2022
Custom Gesture Detector for Flutter. Empower your users with custom gestures.

Gestures Custom Gesture Detector for Flutter. Empower your users with custom gestures. How to use In your pubspec.yaml: dependencies: gestures: ^1.0

André Baltazar 11 Nov 4, 2022
Actor model implementation in Dart. This package makes it easier to work with isolates, create clusters of isolates.

Actor model implementation in Dart Languages: Introduction About Theater Installing What is Actor Notes about the actors Actor system Actor tree Using

Gleb Batykov 39 Nov 14, 2022
A Flutter package for show custom in-app notification.

?? in_app_notification A Flutter package to show custom in-app notification with any Widgets. ✍️ Usage Import it. dependencies: in_app_notificatio

CBcloud 18 Oct 27, 2022
A Flutter package for building custom skeleton widgets to mimic the page's layout while loading.

Skeletons A Flutter package for building custom skeleton widgets to mimic the page's layout while loading. Examples Items ListView (Default) ListView

Moh Badjah 46 Dec 17, 2022
Learn Flutter on Flutter! A widget directory with implementation samples!

Fludget Browse through a variety of widgets used in flutter This application is developed to learn Flutter using Flutter. Different widgets used in fl

ACM VIT 29 Nov 23, 2022
Paper is a implementation of Flx Design System for Flutter

Paper is a implementation of Flx Design System for Flutter. Installing Add a lines like this to your pubspec.yaml. dependencies: paper: git:

Flx Team 3 Nov 21, 2021
Flutter implementation of Figma's corner smoothing.

Figma Squircle Flutter implementation of Figma's corner smoothing. Usage Decoration The SmoothRectangleBorder can be provided to a regular ShapeDecora

Aloïs Deniel 88 Dec 14, 2022
Flutter implementation of Google Mobile Vision.

flutter_mobile_vision Flutter implementation for Google Mobile Vision. Based on Google Mobile Vision. Android Samples -=- iOS Samples Liked? ⭐ Star th

Eduardo Folly 450 Jan 6, 2023
Backdrop implementation in flutter.

backdrop Backdrop implementation in flutter. This widget is in active development. Any contribution, idea, criticism or feedback is welcomed. Quick li

Harsh Bhikadia 6 Jan 6, 2022
a python-like bytes_io implementation for dart

bytes_io A python-like bytes_io implementation for dart A powerful helper for processing raw binary data Usage A simple usage example: import 'package

Kelly 5 Aug 31, 2022
A bugless implementation of BigDecimal in Dart based on Java's BigDecimal

big_decimal A bugless implementation of BigDecimal in Dart based on Java's BigDecimal Installation Add the following to your pubspec.yaml: dependencie

null 18 Jul 27, 2022
Libwinmedia implementation of just_audio.

just_audio_libwinmedia The libwinmedia implementation of [just_audio][https://github.com/ryanheise/just_audio]. Installation Add the just_audio_libwin

Bruno D'Luka 12 Oct 22, 2022
Implementation of FIrebase CRUD App.

firebase_crud_app_flutter A new Flutter application. Getting Started This project is a starting point for a Flutter application. A few resources to ge

Chinmay Munje 0 Nov 4, 2021
Music reader for online data (Google Drive implementation). Cross platform goal : iOS, Android, MacOS, Windows

omusic A new Flutter project. Getting Started This project is a starting point for a Flutter application. A few resources to get you started if this i

JeanNicolasdeLamballerie 0 Nov 30, 2021
A basic implementation of the robot testing pattern for integration/e2e tests

robot A new Flutter project. Getting Started This project is a starting point for a Flutter application. A few resources to get you started if this is

Samuel Abada 3 Dec 13, 2021
This project is a implementation of a collection of terminal server samples in Dart

Terminal Server Samples ⭐ Star me on GitHub — it helps! This project is a implementation of a collection of terminal server samples in Dart licensed u

Javier Montenegro 0 Nov 26, 2021
Implementation and architecture for Firebase Authentication

fluttercompoundapp A new Flutter application. Getting Started This project is a starting point for a Flutter application. A few resources to get you s

Emmanuel Ahuno 0 Nov 27, 2021