├── .gitignore ├── .metadata ├── CHANGELOG.md ├── LICENSE ├── README.md ├── assets └── img │ ├── example3.gif │ ├── example4.gif │ ├── example5.1.gif │ ├── example5.2.gif │ ├── example5.3.gif │ └── pic.png ├── example ├── .gitignore ├── .metadata ├── README.md ├── android │ ├── .gitignore │ ├── .gradle │ │ ├── 5.6.2 │ │ │ ├── executionHistory │ │ │ │ └── executionHistory.bin │ │ │ ├── fileChanges │ │ │ │ └── last-build.bin │ │ │ ├── fileHashes │ │ │ │ ├── fileHashes.bin │ │ │ │ └── resourceHashesCache.bin │ │ │ ├── gc.properties │ │ │ └── javaCompile │ │ │ │ ├── jarAnalysis.bin │ │ │ │ └── taskHistory.bin │ │ ├── buildOutputCleanup │ │ │ ├── cache.properties │ │ │ └── outputFiles.bin │ │ └── vcs-1 │ │ │ └── gc.properties │ ├── app │ │ ├── build.gradle │ │ └── src │ │ │ ├── debug │ │ │ └── AndroidManifest.xml │ │ │ ├── main │ │ │ ├── AndroidManifest.xml │ │ │ └── java │ │ │ │ ├── com │ │ │ │ └── example │ │ │ │ │ └── flutterinnerdrawer │ │ │ │ │ └── MainActivity.java │ │ │ │ └── io │ │ │ │ └── flutter │ │ │ │ └── plugins │ │ │ │ └── GeneratedPluginRegistrant.java │ │ │ └── profile │ │ │ └── AndroidManifest.xml │ ├── build.gradle │ ├── gradle.properties │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── gradlew.bat │ ├── local.properties │ └── settings.gradle ├── fonts │ └── ico │ │ └── icomoon.ttf ├── ios │ ├── Flutter │ │ ├── AppFrameworkInfo.plist │ │ ├── Debug.xcconfig │ │ ├── Release.xcconfig │ │ └── flutter_export_environment.sh │ ├── Runner.xcodeproj │ │ ├── project.pbxproj │ │ ├── project.xcworkspace │ │ │ └── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ └── xcschemes │ │ │ └── Runner.xcscheme │ ├── Runner.xcworkspace │ │ └── contents.xcworkspacedata │ └── Runner │ │ ├── AppDelegate.swift │ │ ├── Assets.xcassets │ │ ├── AppIcon.appiconset │ │ │ ├── Contents.json │ │ │ ├── Icon-App-1024x1024@1x.png │ │ │ ├── Icon-App-20x20@1x.png │ │ │ ├── Icon-App-20x20@2x.png │ │ │ ├── Icon-App-20x20@3x.png │ │ │ ├── Icon-App-29x29@1x.png │ │ │ ├── Icon-App-29x29@2x.png │ │ │ ├── Icon-App-29x29@3x.png │ │ │ ├── Icon-App-40x40@1x.png │ │ │ ├── Icon-App-40x40@2x.png │ │ │ ├── Icon-App-40x40@3x.png │ │ │ ├── Icon-App-60x60@2x.png │ │ │ ├── Icon-App-60x60@3x.png │ │ │ ├── Icon-App-76x76@1x.png │ │ │ ├── Icon-App-76x76@2x.png │ │ │ └── Icon-App-83.5x83.5@2x.png │ │ └── LaunchImage.imageset │ │ │ ├── Contents.json │ │ │ ├── LaunchImage.png │ │ │ ├── LaunchImage@2x.png │ │ │ ├── LaunchImage@3x.png │ │ │ └── README.md │ │ ├── Base.lproj │ │ ├── LaunchScreen.storyboard │ │ └── Main.storyboard │ │ ├── Info.plist │ │ └── Runner-Bridging-Header.h ├── lib │ ├── children │ │ ├── left_child_1.dart │ │ └── right_child_1.dart │ ├── env.dart │ ├── example_1.dart │ ├── example_2.dart │ ├── example_3.dart │ ├── generated │ │ └── i18n.dart │ ├── main.dart │ ├── notifier │ │ └── drawer_notifier.dart │ └── scaffolds │ │ └── scaffolds_1.dart ├── pubspec.yaml └── test │ └── widget_test.dart ├── flutter_inner_drawer.iml ├── lib └── inner_drawer.dart ├── pubspec.lock ├── pubspec.yaml └── test └── flutter_inner_drawer_test.dart /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | .dart_tool/ 3 | 4 | .packages 5 | .pub/ 6 | 7 | build/ 8 | ios/.generated/ 9 | ios/Flutter/Generated.xcconfig 10 | ios/Runner/GeneratedPluginRegistrant.* 11 | 12 | lib/generated/ 13 | res/ 14 | .idea/ 15 | #android/ -------------------------------------------------------------------------------- /.metadata: -------------------------------------------------------------------------------- 1 | # This file tracks properties of this Flutter project. 2 | # Used by Flutter tool to assess capabilities and perform upgrades etc. 3 | # 4 | # This file should be version controlled and should not be manually edited. 5 | 6 | version: 7 | revision: 5391447fae6209bb21a89e6a5a6583cac1af9b4b 8 | channel: beta 9 | 10 | project_type: package 11 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## [1.0.0+1] - 2021-03-17. 2 | 3 | * [Fixed] - Improvement null safety support. 4 | 5 | ## [1.0.0] - 2021-03-17. 6 | 7 | * [Updated] - Migrate to stable null safety. 8 | 9 | ## [0.5.8] - 2021-03-17. 10 | 11 | * [Updated] - Flutter 2.0 support. 12 | * [Updated] - example 1. 13 | 14 | ## [0.5.7+2] - 2020-08-05. 15 | 16 | * [Clean] - deprecated functions. 17 | * [Updated] - example 1. 18 | * [Fixed] - issues #43, #47. 19 | 20 | ## [0.5.7+1] - 2020-07-31. 21 | 22 | * [Updated] - Readme. 23 | 24 | ## [0.5.7] - 2020-07-31. 25 | 26 | * [Added] - swipeChild which allows swiping scaffold from left/right child. 27 | * [Fixed] - issue #45. 28 | * [Replaced] - `boxDecoration` with `decoration`. 29 | * [Updated] - Readme. 30 | 31 | ## [0.5.6+1] - 2020-05-14. 32 | 33 | * Update Documentation. 34 | * general improvements. 35 | * `backgroundColor` field replaced by `backgroundDecoration` (BoxDecoration). 36 | 37 | ## [0.5.6] - 2020-05-13. 38 | 39 | * Update Documentation. 40 | * Added `velocity` field. Allows you to set the opening and closing velocity when using the open/close methods. 41 | * `colorTransition` field renamed to `colorTransitionChild`. 42 | * Added `colorTransitionScaffold` field. 43 | 44 | ## [0.5.5+3] - 2020-04-29. 45 | 46 | * Rollback issue #33. 47 | * Fixed some problems. 48 | 49 | ## [0.5.5+2] - 2020-04-28. 50 | 51 | * general improvements. 52 | 53 | ## [0.5.5+1] - 2020-04-28. 54 | 55 | * Fixed issues : #30 and #33. 56 | 57 | ## [0.5.5] - 2020-03-07. 58 | 59 | * Update Documentation. 60 | 61 | ## [0.5.4] - 2019-12-07. 62 | 63 | * Update Readme. 64 | 65 | ## [0.5.3] - 2019-12-07. 66 | 67 | * **new Features and Documentation Updates** 68 | * 69 | * Added `IDOffset` class. An immutable set of offset in each of the four cardinal directions. 70 | * Added `offset` field. `leftOffset` and `rightOffset` Deprecated. 71 | * Added `scale` field. `leftScale` and `rightScale` Deprecated. 72 | * Added `duration` field. Duration of AnimationController. 73 | * Cleaning code. 74 | * Update Readme. 75 | 76 | ## [0.5.2] - 2019-11-15. 77 | 78 | * **General improvement of the code** 79 | * 80 | * Added `backgroundColor` field. 81 | * Fixed some problems related to swipe and scaleFactor. 82 | * Cleaning code. 83 | * Update Readme. 84 | 85 | ## [0.5.1] - 2019-11-09. 86 | 87 | * **General improvement of the code** 88 | * 89 | * Added `proportionalChildArea`. if == true dynamically sets the width based on the selected offset, otherwise it leaves the width at 100% of the screen. 90 | * Possibility to set `boxShadow` also for linear animation. 91 | * When `borderSide` > 0, `boxShadow` did not work. 92 | * Cleaning code. 93 | * Update Readme. 94 | 95 | ## [0.5.0] - 2019-10-16. 96 | 97 | * **new Features and Documentation Updates** 98 | * 99 | * Added `borderRadius` field for scaffold border - (double value). 100 | * Added `leftScale` and `RightScale` fields for scaffold scaling - (double value). 101 | * Added `onDragUpdate(double value, InnerDraweDirection direction)` callback function. 102 | 103 | ## [0.4.0] - 2019-08-07. 104 | 105 | * **new Features and Documentation Updates** 106 | * 107 | * Parameter `position` removed. Now it is possible to define `leftChild` and `rightChild` simultaneously. 108 | * Parameter `offset` replaced with `leftOffset` and `rightOffset`. 109 | * Parameter `animationType` replaced with `leftAnimationType` and `rightAnimationType`. 110 | * Possibility to tap the scaffold even when open with `tapScaffoldEnabled`. 111 | 112 | ## [0.3.0] - 2019-07-07. 113 | 114 | * General improvement of the code. 115 | 116 | ## [0.2.9] - 2019-06-20. 117 | 118 | * Updated dependencies. 119 | * Added toggle method. 120 | 121 | ## [0.2.8] - 2019-06-14. 122 | 123 | * fixed history. 124 | 125 | ## [0.2.7] - 2019-06-14. 126 | 127 | * Cleaning code. 128 | * Update Readme. 129 | 130 | ## [0.2.6] - 2019-05-13. 131 | 132 | * Fixed InnerDrawerCallback. 133 | 134 | ## [0.2.5] - 2019-04-19. 135 | 136 | * General improvement of the code. 137 | 138 | ## [0.2.4] - 2019-04-16. 139 | 140 | * Fixed swipe precision. 141 | 142 | ## [0.2.3] - 2019-04-06. 143 | 144 | * fixed some problem. 145 | * General improvement of the code. 146 | 147 | ## [0.2.2] - 2019-02-26. 148 | 149 | * fixed some artifacts with linear animation. 150 | 151 | ## [0.2.1] - 2019-02-25. 152 | 153 | * solved the problem of CupertinoThemeData that launched an assert. 154 | 155 | ## [0.2.0] - 2019-02-16. 156 | 157 | * 3 types of animation (static - linear - quadratic) 158 | * Improved documentation. 159 | 160 | ## [0.1.5] - 2019-02-13. 161 | 162 | * Improved documentation. 163 | 164 | ## [0.1.4] - 2019-02-13. 165 | 166 | * Improved documentation. 167 | 168 | ## [0.1.3] - 2019-02-13. 169 | 170 | * fixed swipe. 171 | 172 | ## [0.1.2] - 2019-02-13. 173 | 174 | * Added side trigger - Possibility to activate/deactivate the swipe. 175 | 176 | ## [0.1.1] - 2019-02-12. 177 | 178 | * Improved documentation. 179 | 180 | ## [0.1.0] - 2019-02-12. 181 | 182 | * Improved documentation - General improvement of the code. 183 | 184 | ## [0.0.1] - 2019-02-12. 185 | 186 | * Created Inner Drawer. 187 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2018 Antonino Di Natale 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # flutter_inner_drawer 2 | [![pub package](https://img.shields.io/badge/pub-1.0.0+1-orange.svg)](https://pub.dartlang.org/packages/flutter_inner_drawer) 3 | [![Awesome Flutter](https://img.shields.io/badge/Awesome-Flutter-blue.svg?longCache=true&style=flat-square)](https://github.com/Solido/awesome-flutter#drawers) 4 | [![Donate](https://img.shields.io/badge/Donate-PayPal-green.svg)](https://www.paypal.me/dnag88) 5 | 6 | 7 | Inner Drawer is an easy way to create an internal side section (left/right) where you can insert a list menu or other. 8 | 9 | ## Installing 10 | Add this to your package's pubspec.yaml file: 11 | ```dart 12 | dependencies: 13 | flutter_inner_drawer: "^1.0.0+1" 14 | ``` 15 | ## Demo 16 |
17 | 18 | 21 | 24 |
19 | 20 | 22 | 23 |
25 |
26 | 27 | 28 | ### Simple usage 29 | ```dart 30 | import 'package:flutter_inner_drawer/inner_drawer.dart'; 31 | . 32 | . 33 | . 34 | 35 | @override 36 | Widget build(BuildContext context) 37 | { 38 | return InnerDrawer( 39 | key: _innerDrawerKey, 40 | onTapClose: true, // default false 41 | swipe: true, // default true 42 | colorTransitionChild: Color.red, // default Color.black54 43 | colorTransitionScaffold: Color.black54, // default Color.black54 44 | 45 | //When setting the vertical offset, be sure to use only top or bottom 46 | offset: IDOffset.only(bottom: 0.05, right: 0.0, left: 0.0), 47 | 48 | scale: IDOffset.horizontal( 0.8 ), // set the offset in both directions 49 | 50 | proportionalChildArea : true, // default true 51 | borderRadius: 50, // default 0 52 | leftAnimationType: InnerDrawerAnimation.static, // default static 53 | rightAnimationType: InnerDrawerAnimation.quadratic, 54 | backgroundDecoration: BoxDecoration(color: Colors.red ), // default Theme.of(context).backgroundColor 55 | 56 | //when a pointer that is in contact with the screen and moves to the right or left 57 | onDragUpdate: (double val, InnerDrawerDirection direction) { 58 | // return values between 1 and 0 59 | print(val); 60 | // check if the swipe is to the right or to the left 61 | print(direction==InnerDrawerDirection.start); 62 | }, 63 | 64 | innerDrawerCallback: (a) => print(a), // return true (open) or false (close) 65 | leftChild: Container(), // required if rightChild is not set 66 | rightChild: Container(), // required if leftChild is not set 67 | 68 | // A Scaffold is generally used but you are free to use other widgets 69 | // Note: use "automaticallyImplyLeading: false" if you do not personalize "leading" of Bar 70 | scaffold: Scaffold( 71 | appBar: AppBar( 72 | automaticallyImplyLeading: false 73 | ), 74 | ) 75 | /* OR 76 | CupertinoPageScaffold( 77 | navigationBar: CupertinoNavigationBar( 78 | automaticallyImplyLeading: false 79 | ), 80 | ), 81 | */ 82 | ) 83 | } 84 | 85 | // Current State of InnerDrawerState 86 | final GlobalKey _innerDrawerKey = GlobalKey(); 87 | 88 | void _toggle() 89 | { 90 | _innerDrawerKey.currentState.toggle( 91 | // direction is optional 92 | // if not set, the last direction will be used 93 | //InnerDrawerDirection.start OR InnerDrawerDirection.end 94 | direction: InnerDrawerDirection.end 95 | ); 96 | } 97 | 98 | ``` 99 | 100 | ### InnerDrawer Parameters 101 | |PropName|Description|default value| 102 | |:-------|:----------|:------------| 103 | |`scaffold`|*A Scaffold is generally used but you are free to use other widgets*|required| 104 | |`leftChild`|*Inner Widget*|required if rightChild is not set| 105 | |`rightChild`|*Inner Widget*|required if leftChild is not set| 106 | |`leftOffset(deprecated)`|*Offset drawer width*|0.4| 107 | |`rightOffset(deprecated)`|*Offset drawer width*|0.4| 108 | |`leftScale(deprecated)`|*Left scaffold scaling*|1| 109 | |`rightScale(deprecated)`|*Right scaffold scaling*|1| 110 | |`offset`|*Offset InnerDrawer width*|IDOffset.horizontal(0.4)| 111 | |`scale`|*Scaffold scaling*|IDOffset.horizontal(1)| 112 | |`proportionalChildArea`|*If true, dynamically sets the width based on the selected offset, otherwise it leaves the width at 100% of the screen.*|true| 113 | |`borderRadius`|*For scaffold border*|0| 114 | |`onTapClose`|*Tap on the Scaffold closes it*|false| 115 | |`swipe`|*activate or deactivate the swipe*|true| 116 | |`swipeChild`|*activate or deactivate the swipeChild*|false| 117 | |`duration`|*Animation Controller duration*|Duration(milliseconds: 246)| 118 | |`velocity`|*Allows you to set the opening and closing velocity when using the open/close methods*|1| 119 | |`tapScaffoldEnabled`|*Possibility to tap the scaffold even when open*|false| 120 | |`boxShadow`|*BoxShadow of scaffold opened*|[BoxShadow(color: Colors.black.withOpacity(0.5),blurRadius: 5)]| 121 | |`colorTransitionChild`|*Change background color while swiping*|Colors.black54| 122 | `colorTransitionScaffold`|*Change background color while swiping*|Colors.black54| 123 | |`leftAnimationType`|*static / linear / quadratic*|static| 124 | |`rightAnimationType`|*static / linear / quadratic*|static| 125 | |`backgroundDecoration`|*possibility to manage the main background Decoration*|BoxDecoration(color: Theme.of(context).backgroundColor)| 126 | |`innerDrawerCallback`|*Optional callback that is called when a InnerDrawer is opened or closed*|| 127 | |`onDragUpdate`|*When a pointer that is in contact with the screen and moves to the right or left*|| 128 | |`_innerDrawerKey.currentState.open`|*Current State of GlobalKey(check example) - OPEN*|| 129 | |`_innerDrawerKey.currentState.close`|*Current State of GlobalKey(check example) - CLOSE*|| 130 | |`_innerDrawerKey.currentState.toggle`|*Current State of GlobalKey(check example) - OPEN or CLOSE*|| 131 | 132 | ## Donate 133 | It takes time to carry on this project. If you found it useful or learned something from the source code please consider the idea of donating 5, 20, 50 € or whatever you can to support the project. 134 | - [![Donate](https://img.shields.io/badge/Donate-PayPal-green.svg)](https://www.paypal.me/dnag88) 135 | 136 | ## Issues 137 | If you encounter problems, open an issue. Pull request are also welcome. 138 | -------------------------------------------------------------------------------- /assets/img/example3.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dn-a/flutter_inner_drawer/9dbe02e648dd9db8ec018a0ce4b1ca3839cbc0b3/assets/img/example3.gif -------------------------------------------------------------------------------- /assets/img/example4.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dn-a/flutter_inner_drawer/9dbe02e648dd9db8ec018a0ce4b1ca3839cbc0b3/assets/img/example4.gif -------------------------------------------------------------------------------- /assets/img/example5.1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dn-a/flutter_inner_drawer/9dbe02e648dd9db8ec018a0ce4b1ca3839cbc0b3/assets/img/example5.1.gif -------------------------------------------------------------------------------- /assets/img/example5.2.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dn-a/flutter_inner_drawer/9dbe02e648dd9db8ec018a0ce4b1ca3839cbc0b3/assets/img/example5.2.gif -------------------------------------------------------------------------------- /assets/img/example5.3.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dn-a/flutter_inner_drawer/9dbe02e648dd9db8ec018a0ce4b1ca3839cbc0b3/assets/img/example5.3.gif -------------------------------------------------------------------------------- /assets/img/pic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dn-a/flutter_inner_drawer/9dbe02e648dd9db8ec018a0ce4b1ca3839cbc0b3/assets/img/pic.png -------------------------------------------------------------------------------- /example/.gitignore: -------------------------------------------------------------------------------- 1 | # Miscellaneous 2 | *.class 3 | *.lock 4 | *.log 5 | *.pyc 6 | *.swp 7 | .DS_Store 8 | .atom/ 9 | .buildlog/ 10 | .history 11 | .svn/ 12 | 13 | # IntelliJ related 14 | *.iml 15 | *.ipr 16 | *.iws 17 | .idea/ 18 | 19 | # Visual Studio Code related 20 | .vscode/ 21 | 22 | # Flutter/Dart/Pub related 23 | **/doc/api/ 24 | .dart_tool/ 25 | .flutter-plugins 26 | .packages 27 | .pub-cache/ 28 | .pub/ 29 | build/ 30 | 31 | # iOS/XCode related 32 | **/ios/**/*.mode1v3 33 | **/ios/**/*.mode2v3 34 | **/ios/**/*.moved-aside 35 | **/ios/**/*.pbxuser 36 | **/ios/**/*.perspectivev3 37 | **/ios/**/*sync/ 38 | **/ios/**/.sconsign.dblite 39 | **/ios/**/.tags* 40 | **/ios/**/.vagrant/ 41 | **/ios/**/DerivedData/ 42 | **/ios/**/Icon? 43 | **/ios/**/Pods/ 44 | **/ios/**/.symlinks/ 45 | **/ios/**/profile 46 | **/ios/**/xcuserdata 47 | **/ios/.generated/ 48 | **/ios/Flutter/App.framework 49 | **/ios/Flutter/Flutter.framework 50 | **/ios/Flutter/Generated.xcconfig 51 | **/ios/Flutter/app.flx 52 | **/ios/Flutter/app.zip 53 | **/ios/Flutter/flutter_assets/ 54 | **/ios/ServiceDefinitions.json 55 | **/ios/Runner/GeneratedPluginRegistrant.* 56 | 57 | # Exceptions to above rules. 58 | !**/ios/**/default.mode1v3 59 | !**/ios/**/default.mode2v3 60 | !**/ios/**/default.pbxuser 61 | !**/ios/**/default.perspectivev3 62 | !/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages 63 | -------------------------------------------------------------------------------- /example/.metadata: -------------------------------------------------------------------------------- 1 | # This file tracks properties of this Flutter project. 2 | # Used by Flutter tool to assess capabilities and perform upgrades etc. 3 | # 4 | # This file should be version controlled and should not be manually edited. 5 | 6 | version: 7 | revision: 5391447fae6209bb21a89e6a5a6583cac1af9b4b 8 | channel: beta 9 | 10 | project_type: app 11 | -------------------------------------------------------------------------------- /example/README.md: -------------------------------------------------------------------------------- 1 | # Example Inner Drawer 2 | 3 | An example of how you could implement it. 4 | 5 | ## Getting Started - Inner Drawer 6 | 7 | ```dart 8 | import 'package:flutter/cupertino.dart'; 9 | import 'package:flutter/material.dart'; 10 | import 'package:flutter/services.dart'; 11 | 12 | import 'example_1.dart'; 13 | import 'example_2.dart'; 14 | 15 | void main() => runApp(MyApp()); 16 | 17 | class MyApp extends StatelessWidget { 18 | @override 19 | Widget build(BuildContext context) { 20 | return MaterialApp( 21 | title: 'Inner Drawer', 22 | theme: ThemeData( 23 | primarySwatch: Colors.blueGrey, 24 | backgroundColor: Colors.white, 25 | ), 26 | home: MainApp(), 27 | ); 28 | } 29 | } 30 | 31 | enum Example { 32 | one, 33 | two, 34 | } 35 | 36 | class MainApp extends StatefulWidget { 37 | MainApp({Key key}) : super(key: key); 38 | 39 | @override 40 | _MainAppState createState() => _MainAppState(); 41 | } 42 | 43 | class _MainAppState extends State with SingleTickerProviderStateMixin { 44 | bool isOpened = false; 45 | AnimationController _animationController; 46 | Animation _buttonColor; 47 | Animation _animateIcon; 48 | Animation _translateButton; 49 | Curve _curve = Curves.easeOut; 50 | double _fabHeight = 56.0; 51 | 52 | Example _currentExample = Example.one; 53 | 54 | @override 55 | initState() { 56 | super.initState(); 57 | 58 | SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle( 59 | //systemNavigationBarColor: Colors.blue, 60 | statusBarColor: Colors.transparent, 61 | //statusBarBrightness: Brightness.dark, 62 | )); 63 | 64 | _animationController = 65 | AnimationController(vsync: this, duration: Duration(milliseconds: 500)) 66 | ..addListener(() { 67 | setState(() {}); 68 | }); 69 | _animateIcon = 70 | Tween(begin: 0.0, end: 1.0).animate(_animationController); 71 | _buttonColor = ColorTween( 72 | begin: Colors.black45, 73 | end: Colors.red, 74 | ).animate(CurvedAnimation( 75 | parent: _animationController, 76 | curve: Interval( 77 | 0.00, 78 | 1.00, 79 | curve: Curves.linear, 80 | ), 81 | )); 82 | _translateButton = Tween( 83 | begin: _fabHeight, 84 | end: -14.0, 85 | ).animate(CurvedAnimation( 86 | parent: _animationController, 87 | curve: Interval( 88 | 0.0, 89 | 0.75, 90 | curve: _curve, 91 | ), 92 | )); 93 | } 94 | 95 | @override 96 | void dispose() { 97 | _animationController.dispose(); 98 | super.dispose(); 99 | } 100 | 101 | @override 102 | Widget build(BuildContext context) { 103 | return Stack( 104 | children: [ 105 | _switchWidget(_currentExample), 106 | Container( 107 | padding: EdgeInsets.all(20), 108 | alignment: Alignment.bottomRight, 109 | child: Column( 110 | mainAxisAlignment: MainAxisAlignment.end, 111 | children: [ 112 | Transform( 113 | transform: Matrix4.translationValues( 114 | 0.0, 115 | _translateButton.value * 2, 116 | 0.0, 117 | ), 118 | child: _item(title: "One", example: Example.one), 119 | ), 120 | Transform( 121 | transform: Matrix4.translationValues( 122 | 0.0, 123 | _translateButton.value * 1, 124 | 0.0, 125 | ), 126 | child: _item(title: "Two", example: Example.two), 127 | ), 128 | _toggle(), 129 | ], 130 | ), 131 | ) 132 | ], 133 | ); 134 | } 135 | 136 | Widget _switchWidget(Example example) { 137 | switch (example) { 138 | case Example.one: 139 | return ExampleOne(); 140 | break; 141 | case Example.two: 142 | return ExampleTwo(); 143 | break; 144 | } 145 | } 146 | 147 | Widget _item({String title, Example example}) { 148 | //print(((_translateButton.value-66)/60).abs()); 149 | double val = ((_translateButton.value - 56) / 60).abs(); 150 | return Opacity( 151 | opacity: val > 0 ? 1 : 0, 152 | child: FloatingActionButton( 153 | backgroundColor: Colors.white, 154 | elevation: val, 155 | onPressed: () { 156 | setState(() => _currentExample = example); 157 | _animate(); 158 | }, 159 | tooltip: 'Apri', 160 | child: Text( 161 | title, 162 | style: TextStyle( 163 | fontSize: 11, 164 | color: example == Example.one 165 | ? Colors.green[300] 166 | : Colors.orange[300]), 167 | ), 168 | ), 169 | ); 170 | } 171 | 172 | Widget _toggle() { 173 | return new Container( 174 | child: FloatingActionButton( 175 | elevation: 1.5, 176 | backgroundColor: Colors.white, 177 | onPressed: _animate, 178 | tooltip: 'Toggle', 179 | child: AnimatedIcon( 180 | icon: AnimatedIcons.menu_close, 181 | color: _buttonColor.value, 182 | progress: _animateIcon, 183 | ), 184 | ), 185 | ); 186 | } 187 | 188 | void _animate() { 189 | if (Navigator.of(context).canPop()) Navigator.of(context).pop(); 190 | if (!isOpened) 191 | _animationController.forward(); 192 | else 193 | _animationController.reverse(); 194 | isOpened = !isOpened; 195 | } 196 | } 197 | 198 | ``` 199 | 200 | ## DEMO 201 | ![Demo 1](https://github.com/Dn-a/flutter_inner_drawer/blob/master/assets/img/example5.1.gif) 202 | ![Demo 2](https://github.com/Dn-a/flutter_inner_drawer/blob/master/assets/img/example5.3.gif) 203 | 204 | ## Other 205 | This project is a starting point for a Flutter application. 206 | 207 | A few resources to get you started if this is your first Flutter project: 208 | 209 | - [Lab: Write your first Flutter app](https://flutter.io/docs/get-started/codelab) 210 | - [Cookbook: Useful Flutter samples](https://flutter.io/docs/cookbook) 211 | 212 | For help getting started with Flutter, view our 213 | [online documentation](https://flutter.io/docs), which offers tutorials, 214 | samples, guidance on mobile development, and a full API reference. 215 | -------------------------------------------------------------------------------- /example/android/.gitignore: -------------------------------------------------------------------------------- 1 | gradle-wrapper.jar 2 | /.gradle 3 | /captures/ 4 | /gradlew 5 | /gradlew.bat 6 | /local.properties 7 | GeneratedPluginRegistrant.java 8 | -------------------------------------------------------------------------------- /example/android/.gradle/5.6.2/executionHistory/executionHistory.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dn-a/flutter_inner_drawer/9dbe02e648dd9db8ec018a0ce4b1ca3839cbc0b3/example/android/.gradle/5.6.2/executionHistory/executionHistory.bin -------------------------------------------------------------------------------- /example/android/.gradle/5.6.2/fileChanges/last-build.bin: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /example/android/.gradle/5.6.2/fileHashes/fileHashes.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dn-a/flutter_inner_drawer/9dbe02e648dd9db8ec018a0ce4b1ca3839cbc0b3/example/android/.gradle/5.6.2/fileHashes/fileHashes.bin -------------------------------------------------------------------------------- /example/android/.gradle/5.6.2/fileHashes/resourceHashesCache.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dn-a/flutter_inner_drawer/9dbe02e648dd9db8ec018a0ce4b1ca3839cbc0b3/example/android/.gradle/5.6.2/fileHashes/resourceHashesCache.bin -------------------------------------------------------------------------------- /example/android/.gradle/5.6.2/gc.properties: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dn-a/flutter_inner_drawer/9dbe02e648dd9db8ec018a0ce4b1ca3839cbc0b3/example/android/.gradle/5.6.2/gc.properties -------------------------------------------------------------------------------- /example/android/.gradle/5.6.2/javaCompile/jarAnalysis.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dn-a/flutter_inner_drawer/9dbe02e648dd9db8ec018a0ce4b1ca3839cbc0b3/example/android/.gradle/5.6.2/javaCompile/jarAnalysis.bin -------------------------------------------------------------------------------- /example/android/.gradle/5.6.2/javaCompile/taskHistory.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dn-a/flutter_inner_drawer/9dbe02e648dd9db8ec018a0ce4b1ca3839cbc0b3/example/android/.gradle/5.6.2/javaCompile/taskHistory.bin -------------------------------------------------------------------------------- /example/android/.gradle/buildOutputCleanup/cache.properties: -------------------------------------------------------------------------------- 1 | #Sat Mar 14 19:01:29 CET 2020 2 | gradle.version=5.6.2 3 | -------------------------------------------------------------------------------- /example/android/.gradle/buildOutputCleanup/outputFiles.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dn-a/flutter_inner_drawer/9dbe02e648dd9db8ec018a0ce4b1ca3839cbc0b3/example/android/.gradle/buildOutputCleanup/outputFiles.bin -------------------------------------------------------------------------------- /example/android/.gradle/vcs-1/gc.properties: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dn-a/flutter_inner_drawer/9dbe02e648dd9db8ec018a0ce4b1ca3839cbc0b3/example/android/.gradle/vcs-1/gc.properties -------------------------------------------------------------------------------- /example/android/app/build.gradle: -------------------------------------------------------------------------------- 1 | def localProperties = new Properties() 2 | def localPropertiesFile = rootProject.file('local.properties') 3 | if (localPropertiesFile.exists()) { 4 | localPropertiesFile.withReader('UTF-8') { reader -> 5 | localProperties.load(reader) 6 | } 7 | } 8 | 9 | def flutterRoot = localProperties.getProperty('flutter.sdk') 10 | if (flutterRoot == null) { 11 | throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") 12 | } 13 | 14 | def flutterVersionCode = localProperties.getProperty('flutter.versionCode') 15 | if (flutterVersionCode == null) { 16 | flutterVersionCode = '1' 17 | } 18 | 19 | def flutterVersionName = localProperties.getProperty('flutter.versionName') 20 | if (flutterVersionName == null) { 21 | flutterVersionName = '1.0' 22 | } 23 | 24 | apply plugin: 'com.android.application' 25 | apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" 26 | 27 | android { 28 | compileSdkVersion 28 29 | 30 | lintOptions { 31 | disable 'InvalidPackage' 32 | } 33 | 34 | defaultConfig { 35 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). 36 | applicationId "com.example.flutterinnerdrawer" 37 | minSdkVersion 16 38 | targetSdkVersion 28 39 | versionCode flutterVersionCode.toInteger() 40 | versionName flutterVersionName 41 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" 42 | } 43 | 44 | buildTypes { 45 | release { 46 | // TODO: Add your own signing config for the release build. 47 | // Signing with the debug keys for now, so `flutter run --release` works. 48 | signingConfig signingConfigs.debug 49 | } 50 | } 51 | } 52 | 53 | flutter { 54 | source '../..' 55 | } 56 | 57 | dependencies { 58 | testImplementation 'junit:junit:4.12' 59 | androidTestImplementation 'androidx.test:runner:1.1.1' 60 | androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1' 61 | } 62 | -------------------------------------------------------------------------------- /example/android/app/src/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /example/android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 8 | 9 | 13 | 20 | 21 | 22 | 23 | 24 | 25 | 27 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /example/android/app/src/main/java/com/example/flutterinnerdrawer/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.example.flutterinnerdrawer; 2 | 3 | import androidx.annotation.NonNull; 4 | import io.flutter.embedding.android.FlutterActivity; 5 | import io.flutter.embedding.engine.FlutterEngine; 6 | import io.flutter.plugins.GeneratedPluginRegistrant; 7 | 8 | public class MainActivity extends FlutterActivity { 9 | @Override 10 | public void configureFlutterEngine(@NonNull FlutterEngine flutterEngine) { 11 | GeneratedPluginRegistrant.registerWith(flutterEngine); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /example/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java: -------------------------------------------------------------------------------- 1 | package io.flutter.plugins; 2 | 3 | import androidx.annotation.Keep; 4 | import androidx.annotation.NonNull; 5 | 6 | import io.flutter.embedding.engine.FlutterEngine; 7 | 8 | /** 9 | * Generated file. Do not edit. 10 | * This file is generated by the Flutter tool based on the 11 | * plugins that support the Android platform. 12 | */ 13 | @Keep 14 | public final class GeneratedPluginRegistrant { 15 | public static void registerWith(@NonNull FlutterEngine flutterEngine) { 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /example/android/app/src/profile/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /example/android/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | repositories { 3 | google() 4 | jcenter() 5 | } 6 | 7 | dependencies { 8 | classpath 'com.android.tools.build:gradle:3.5.0' 9 | } 10 | } 11 | 12 | allprojects { 13 | repositories { 14 | google() 15 | jcenter() 16 | } 17 | } 18 | 19 | rootProject.buildDir = '../build' 20 | subprojects { 21 | project.buildDir = "${rootProject.buildDir}/${project.name}" 22 | } 23 | subprojects { 24 | project.evaluationDependsOn(':app') 25 | } 26 | 27 | task clean(type: Delete) { 28 | delete rootProject.buildDir 29 | } 30 | -------------------------------------------------------------------------------- /example/android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1536M 2 | android.enableR8=true 3 | android.useAndroidX=true 4 | android.enableJetifier=true 5 | -------------------------------------------------------------------------------- /example/android/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dn-a/flutter_inner_drawer/9dbe02e648dd9db8ec018a0ce4b1ca3839cbc0b3/example/android/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /example/android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Fri Jun 23 08:50:38 CEST 2017 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-all.zip 7 | -------------------------------------------------------------------------------- /example/android/gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ############################################################################## 4 | ## 5 | ## Gradle start up script for UN*X 6 | ## 7 | ############################################################################## 8 | 9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 10 | DEFAULT_JVM_OPTS="" 11 | 12 | APP_NAME="Gradle" 13 | APP_BASE_NAME=`basename "$0"` 14 | 15 | # Use the maximum available, or set MAX_FD != -1 to use that value. 16 | MAX_FD="maximum" 17 | 18 | warn ( ) { 19 | echo "$*" 20 | } 21 | 22 | die ( ) { 23 | echo 24 | echo "$*" 25 | echo 26 | exit 1 27 | } 28 | 29 | # OS specific support (must be 'true' or 'false'). 30 | cygwin=false 31 | msys=false 32 | darwin=false 33 | case "`uname`" in 34 | CYGWIN* ) 35 | cygwin=true 36 | ;; 37 | Darwin* ) 38 | darwin=true 39 | ;; 40 | MINGW* ) 41 | msys=true 42 | ;; 43 | esac 44 | 45 | # Attempt to set APP_HOME 46 | # Resolve links: $0 may be a link 47 | PRG="$0" 48 | # Need this for relative symlinks. 49 | while [ -h "$PRG" ] ; do 50 | ls=`ls -ld "$PRG"` 51 | link=`expr "$ls" : '.*-> \(.*\)$'` 52 | if expr "$link" : '/.*' > /dev/null; then 53 | PRG="$link" 54 | else 55 | PRG=`dirname "$PRG"`"/$link" 56 | fi 57 | done 58 | SAVED="`pwd`" 59 | cd "`dirname \"$PRG\"`/" >/dev/null 60 | APP_HOME="`pwd -P`" 61 | cd "$SAVED" >/dev/null 62 | 63 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 64 | 65 | # Determine the Java command to use to start the JVM. 66 | if [ -n "$JAVA_HOME" ] ; then 67 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 68 | # IBM's JDK on AIX uses strange locations for the executables 69 | JAVACMD="$JAVA_HOME/jre/sh/java" 70 | else 71 | JAVACMD="$JAVA_HOME/bin/java" 72 | fi 73 | if [ ! -x "$JAVACMD" ] ; then 74 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 75 | 76 | Please set the JAVA_HOME variable in your environment to match the 77 | location of your Java installation." 78 | fi 79 | else 80 | JAVACMD="java" 81 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 82 | 83 | Please set the JAVA_HOME variable in your environment to match the 84 | location of your Java installation." 85 | fi 86 | 87 | # Increase the maximum file descriptors if we can. 88 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then 89 | MAX_FD_LIMIT=`ulimit -H -n` 90 | if [ $? -eq 0 ] ; then 91 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 92 | MAX_FD="$MAX_FD_LIMIT" 93 | fi 94 | ulimit -n $MAX_FD 95 | if [ $? -ne 0 ] ; then 96 | warn "Could not set maximum file descriptor limit: $MAX_FD" 97 | fi 98 | else 99 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 100 | fi 101 | fi 102 | 103 | # For Darwin, add options to specify how the application appears in the dock 104 | if $darwin; then 105 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 106 | fi 107 | 108 | # For Cygwin, switch paths to Windows format before running java 109 | if $cygwin ; then 110 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 111 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 112 | JAVACMD=`cygpath --unix "$JAVACMD"` 113 | 114 | # We build the pattern for arguments to be converted via cygpath 115 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 116 | SEP="" 117 | for dir in $ROOTDIRSRAW ; do 118 | ROOTDIRS="$ROOTDIRS$SEP$dir" 119 | SEP="|" 120 | done 121 | OURCYGPATTERN="(^($ROOTDIRS))" 122 | # Add a user-defined pattern to the cygpath arguments 123 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 124 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 125 | fi 126 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 127 | i=0 128 | for arg in "$@" ; do 129 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 130 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 131 | 132 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 133 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 134 | else 135 | eval `echo args$i`="\"$arg\"" 136 | fi 137 | i=$((i+1)) 138 | done 139 | case $i in 140 | (0) set -- ;; 141 | (1) set -- "$args0" ;; 142 | (2) set -- "$args0" "$args1" ;; 143 | (3) set -- "$args0" "$args1" "$args2" ;; 144 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;; 145 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 146 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 147 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 148 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 149 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 150 | esac 151 | fi 152 | 153 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules 154 | function splitJvmOpts() { 155 | JVM_OPTS=("$@") 156 | } 157 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS 158 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" 159 | 160 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" 161 | -------------------------------------------------------------------------------- /example/android/gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 12 | set DEFAULT_JVM_OPTS= 13 | 14 | set DIRNAME=%~dp0 15 | if "%DIRNAME%" == "" set DIRNAME=. 16 | set APP_BASE_NAME=%~n0 17 | set APP_HOME=%DIRNAME% 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windowz variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /example/android/local.properties: -------------------------------------------------------------------------------- 1 | sdk.dir=C:\\Users\\NINU0\\AppData\\Local\\Android\\Sdk 2 | flutter.sdk=C:\\flutter 3 | flutter.buildMode=release 4 | flutter.versionName=1.0.0 5 | flutter.versionCode=1 -------------------------------------------------------------------------------- /example/android/settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | 3 | def flutterProjectRoot = rootProject.projectDir.parentFile.toPath() 4 | 5 | def plugins = new Properties() 6 | def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins') 7 | if (pluginsFile.exists()) { 8 | pluginsFile.withReader('UTF-8') { reader -> plugins.load(reader) } 9 | } 10 | 11 | plugins.each { name, path -> 12 | def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile() 13 | include ":$name" 14 | project(":$name").projectDir = pluginDirectory 15 | } 16 | -------------------------------------------------------------------------------- /example/fonts/ico/icomoon.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dn-a/flutter_inner_drawer/9dbe02e648dd9db8ec018a0ce4b1ca3839cbc0b3/example/fonts/ico/icomoon.ttf -------------------------------------------------------------------------------- /example/ios/Flutter/AppFrameworkInfo.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | App 9 | CFBundleIdentifier 10 | io.flutter.flutter.app 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | App 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1.0 23 | MinimumOSVersion 24 | 8.0 25 | 26 | 27 | -------------------------------------------------------------------------------- /example/ios/Flutter/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /example/ios/Flutter/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /example/ios/Flutter/flutter_export_environment.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # This is a generated file; do not edit or check into version control. 3 | export "FLUTTER_ROOT=C:\flutter" 4 | export "FLUTTER_APPLICATION_PATH=D:\Android\Flutter\package\flutter_inner_drawer\example" 5 | export "FLUTTER_TARGET=lib\main.dart" 6 | export "FLUTTER_BUILD_DIR=build" 7 | export "SYMROOT=${SOURCE_ROOT}/../build\ios" 8 | export "FLUTTER_BUILD_NAME=1.0.0" 9 | export "FLUTTER_BUILD_NUMBER=1" 10 | export "DART_OBFUSCATION=false" 11 | export "TRACK_WIDGET_CREATION=false" 12 | export "TREE_SHAKE_ICONS=false" 13 | export "PACKAGE_CONFIG=.packages" 14 | -------------------------------------------------------------------------------- /example/ios/Runner.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; 11 | 2D5378261FAA1A9400D5DBA9 /* flutter_assets in Resources */ = {isa = PBXBuildFile; fileRef = 2D5378251FAA1A9400D5DBA9 /* flutter_assets */; }; 12 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; 13 | 3B80C3941E831B6300D905FE /* App.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; }; 14 | 3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 15 | 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; 16 | 9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; }; 17 | 9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 18 | 9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 9740EEB21CF90195004384FC /* Debug.xcconfig */; }; 19 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; 20 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; 21 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; 22 | /* End PBXBuildFile section */ 23 | 24 | /* Begin PBXCopyFilesBuildPhase section */ 25 | 9705A1C41CF9048500538489 /* Embed Frameworks */ = { 26 | isa = PBXCopyFilesBuildPhase; 27 | buildActionMask = 2147483647; 28 | dstPath = ""; 29 | dstSubfolderSpec = 10; 30 | files = ( 31 | 3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */, 32 | 9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */, 33 | ); 34 | name = "Embed Frameworks"; 35 | runOnlyForDeploymentPostprocessing = 0; 36 | }; 37 | /* End PBXCopyFilesBuildPhase section */ 38 | 39 | /* Begin PBXFileReference section */ 40 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; 41 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; 42 | 2D5378251FAA1A9400D5DBA9 /* flutter_assets */ = {isa = PBXFileReference; lastKnownFileType = folder; name = flutter_assets; path = Flutter/flutter_assets; sourceTree = SOURCE_ROOT; }; 43 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; 44 | 3B80C3931E831B6300D905FE /* App.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = App.framework; path = Flutter/App.framework; sourceTree = ""; }; 45 | 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; 46 | 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 47 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; 48 | 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; 49 | 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; 50 | 9740EEBA1CF902C7004384FC /* Flutter.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Flutter.framework; path = Flutter/Flutter.framework; sourceTree = ""; }; 51 | 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; 52 | 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 53 | 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 54 | 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 55 | 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 56 | /* End PBXFileReference section */ 57 | 58 | /* Begin PBXFrameworksBuildPhase section */ 59 | 97C146EB1CF9000F007C117D /* Frameworks */ = { 60 | isa = PBXFrameworksBuildPhase; 61 | buildActionMask = 2147483647; 62 | files = ( 63 | 9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */, 64 | 3B80C3941E831B6300D905FE /* App.framework in Frameworks */, 65 | ); 66 | runOnlyForDeploymentPostprocessing = 0; 67 | }; 68 | /* End PBXFrameworksBuildPhase section */ 69 | 70 | /* Begin PBXGroup section */ 71 | 9740EEB11CF90186004384FC /* Flutter */ = { 72 | isa = PBXGroup; 73 | children = ( 74 | 2D5378251FAA1A9400D5DBA9 /* flutter_assets */, 75 | 3B80C3931E831B6300D905FE /* App.framework */, 76 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, 77 | 9740EEBA1CF902C7004384FC /* Flutter.framework */, 78 | 9740EEB21CF90195004384FC /* Debug.xcconfig */, 79 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, 80 | 9740EEB31CF90195004384FC /* Generated.xcconfig */, 81 | ); 82 | name = Flutter; 83 | sourceTree = ""; 84 | }; 85 | 97C146E51CF9000F007C117D = { 86 | isa = PBXGroup; 87 | children = ( 88 | 9740EEB11CF90186004384FC /* Flutter */, 89 | 97C146F01CF9000F007C117D /* Runner */, 90 | 97C146EF1CF9000F007C117D /* Products */, 91 | ); 92 | sourceTree = ""; 93 | }; 94 | 97C146EF1CF9000F007C117D /* Products */ = { 95 | isa = PBXGroup; 96 | children = ( 97 | 97C146EE1CF9000F007C117D /* Runner.app */, 98 | ); 99 | name = Products; 100 | sourceTree = ""; 101 | }; 102 | 97C146F01CF9000F007C117D /* Runner */ = { 103 | isa = PBXGroup; 104 | children = ( 105 | 97C146FA1CF9000F007C117D /* Main.storyboard */, 106 | 97C146FD1CF9000F007C117D /* Assets.xcassets */, 107 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, 108 | 97C147021CF9000F007C117D /* Info.plist */, 109 | 97C146F11CF9000F007C117D /* Supporting Files */, 110 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, 111 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, 112 | 74858FAE1ED2DC5600515810 /* AppDelegate.swift */, 113 | 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */, 114 | ); 115 | path = Runner; 116 | sourceTree = ""; 117 | }; 118 | 97C146F11CF9000F007C117D /* Supporting Files */ = { 119 | isa = PBXGroup; 120 | children = ( 121 | ); 122 | name = "Supporting Files"; 123 | sourceTree = ""; 124 | }; 125 | /* End PBXGroup section */ 126 | 127 | /* Begin PBXNativeTarget section */ 128 | 97C146ED1CF9000F007C117D /* Runner */ = { 129 | isa = PBXNativeTarget; 130 | buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; 131 | buildPhases = ( 132 | 9740EEB61CF901F6004384FC /* Run Script */, 133 | 97C146EA1CF9000F007C117D /* Sources */, 134 | 97C146EB1CF9000F007C117D /* Frameworks */, 135 | 97C146EC1CF9000F007C117D /* Resources */, 136 | 9705A1C41CF9048500538489 /* Embed Frameworks */, 137 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */, 138 | ); 139 | buildRules = ( 140 | ); 141 | dependencies = ( 142 | ); 143 | name = Runner; 144 | productName = Runner; 145 | productReference = 97C146EE1CF9000F007C117D /* Runner.app */; 146 | productType = "com.apple.product-type.application"; 147 | }; 148 | /* End PBXNativeTarget section */ 149 | 150 | /* Begin PBXProject section */ 151 | 97C146E61CF9000F007C117D /* Project object */ = { 152 | isa = PBXProject; 153 | attributes = { 154 | LastUpgradeCheck = 0910; 155 | ORGANIZATIONNAME = "The Chromium Authors"; 156 | TargetAttributes = { 157 | 97C146ED1CF9000F007C117D = { 158 | CreatedOnToolsVersion = 7.3.1; 159 | LastSwiftMigration = 0910; 160 | }; 161 | }; 162 | }; 163 | buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; 164 | compatibilityVersion = "Xcode 3.2"; 165 | developmentRegion = English; 166 | hasScannedForEncodings = 0; 167 | knownRegions = ( 168 | en, 169 | Base, 170 | ); 171 | mainGroup = 97C146E51CF9000F007C117D; 172 | productRefGroup = 97C146EF1CF9000F007C117D /* Products */; 173 | projectDirPath = ""; 174 | projectRoot = ""; 175 | targets = ( 176 | 97C146ED1CF9000F007C117D /* Runner */, 177 | ); 178 | }; 179 | /* End PBXProject section */ 180 | 181 | /* Begin PBXResourcesBuildPhase section */ 182 | 97C146EC1CF9000F007C117D /* Resources */ = { 183 | isa = PBXResourcesBuildPhase; 184 | buildActionMask = 2147483647; 185 | files = ( 186 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, 187 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, 188 | 9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */, 189 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, 190 | 2D5378261FAA1A9400D5DBA9 /* flutter_assets in Resources */, 191 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, 192 | ); 193 | runOnlyForDeploymentPostprocessing = 0; 194 | }; 195 | /* End PBXResourcesBuildPhase section */ 196 | 197 | /* Begin PBXShellScriptBuildPhase section */ 198 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { 199 | isa = PBXShellScriptBuildPhase; 200 | buildActionMask = 2147483647; 201 | files = ( 202 | ); 203 | inputPaths = ( 204 | ); 205 | name = "Thin Binary"; 206 | outputPaths = ( 207 | ); 208 | runOnlyForDeploymentPostprocessing = 0; 209 | shellPath = /bin/sh; 210 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" thin"; 211 | }; 212 | 9740EEB61CF901F6004384FC /* Run Script */ = { 213 | isa = PBXShellScriptBuildPhase; 214 | buildActionMask = 2147483647; 215 | files = ( 216 | ); 217 | inputPaths = ( 218 | ); 219 | name = "Run Script"; 220 | outputPaths = ( 221 | ); 222 | runOnlyForDeploymentPostprocessing = 0; 223 | shellPath = /bin/sh; 224 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; 225 | }; 226 | /* End PBXShellScriptBuildPhase section */ 227 | 228 | /* Begin PBXSourcesBuildPhase section */ 229 | 97C146EA1CF9000F007C117D /* Sources */ = { 230 | isa = PBXSourcesBuildPhase; 231 | buildActionMask = 2147483647; 232 | files = ( 233 | 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */, 234 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, 235 | ); 236 | runOnlyForDeploymentPostprocessing = 0; 237 | }; 238 | /* End PBXSourcesBuildPhase section */ 239 | 240 | /* Begin PBXVariantGroup section */ 241 | 97C146FA1CF9000F007C117D /* Main.storyboard */ = { 242 | isa = PBXVariantGroup; 243 | children = ( 244 | 97C146FB1CF9000F007C117D /* Base */, 245 | ); 246 | name = Main.storyboard; 247 | sourceTree = ""; 248 | }; 249 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = { 250 | isa = PBXVariantGroup; 251 | children = ( 252 | 97C147001CF9000F007C117D /* Base */, 253 | ); 254 | name = LaunchScreen.storyboard; 255 | sourceTree = ""; 256 | }; 257 | /* End PBXVariantGroup section */ 258 | 259 | /* Begin XCBuildConfiguration section */ 260 | 249021D3217E4FDB00AE95B9 /* Profile */ = { 261 | isa = XCBuildConfiguration; 262 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 263 | buildSettings = { 264 | ALWAYS_SEARCH_USER_PATHS = NO; 265 | CLANG_ANALYZER_NONNULL = YES; 266 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 267 | CLANG_CXX_LIBRARY = "libc++"; 268 | CLANG_ENABLE_MODULES = YES; 269 | CLANG_ENABLE_OBJC_ARC = YES; 270 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 271 | CLANG_WARN_BOOL_CONVERSION = YES; 272 | CLANG_WARN_COMMA = YES; 273 | CLANG_WARN_CONSTANT_CONVERSION = YES; 274 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 275 | CLANG_WARN_EMPTY_BODY = YES; 276 | CLANG_WARN_ENUM_CONVERSION = YES; 277 | CLANG_WARN_INFINITE_RECURSION = YES; 278 | CLANG_WARN_INT_CONVERSION = YES; 279 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 280 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 281 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 282 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 283 | CLANG_WARN_STRICT_PROTOTYPES = YES; 284 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 285 | CLANG_WARN_UNREACHABLE_CODE = YES; 286 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 287 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 288 | COPY_PHASE_STRIP = NO; 289 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 290 | ENABLE_NS_ASSERTIONS = NO; 291 | ENABLE_STRICT_OBJC_MSGSEND = YES; 292 | GCC_C_LANGUAGE_STANDARD = gnu99; 293 | GCC_NO_COMMON_BLOCKS = YES; 294 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 295 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 296 | GCC_WARN_UNDECLARED_SELECTOR = YES; 297 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 298 | GCC_WARN_UNUSED_FUNCTION = YES; 299 | GCC_WARN_UNUSED_VARIABLE = YES; 300 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 301 | MTL_ENABLE_DEBUG_INFO = NO; 302 | SDKROOT = iphoneos; 303 | TARGETED_DEVICE_FAMILY = "1,2"; 304 | VALIDATE_PRODUCT = YES; 305 | }; 306 | name = Profile; 307 | }; 308 | 249021D4217E4FDB00AE95B9 /* Profile */ = { 309 | isa = XCBuildConfiguration; 310 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 311 | buildSettings = { 312 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 313 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 314 | DEVELOPMENT_TEAM = S8QB4VV633; 315 | ENABLE_BITCODE = NO; 316 | FRAMEWORK_SEARCH_PATHS = ( 317 | "$(inherited)", 318 | "$(PROJECT_DIR)/Flutter", 319 | ); 320 | INFOPLIST_FILE = Runner/Info.plist; 321 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 322 | LIBRARY_SEARCH_PATHS = ( 323 | "$(inherited)", 324 | "$(PROJECT_DIR)/Flutter", 325 | ); 326 | PRODUCT_BUNDLE_IDENTIFIER = com.dna.exampleInnerDrawer; 327 | PRODUCT_NAME = "$(TARGET_NAME)"; 328 | SWIFT_VERSION = 4.0; 329 | VERSIONING_SYSTEM = "apple-generic"; 330 | }; 331 | name = Profile; 332 | }; 333 | 97C147031CF9000F007C117D /* Debug */ = { 334 | isa = XCBuildConfiguration; 335 | baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; 336 | buildSettings = { 337 | ALWAYS_SEARCH_USER_PATHS = NO; 338 | CLANG_ANALYZER_NONNULL = YES; 339 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 340 | CLANG_CXX_LIBRARY = "libc++"; 341 | CLANG_ENABLE_MODULES = YES; 342 | CLANG_ENABLE_OBJC_ARC = YES; 343 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 344 | CLANG_WARN_BOOL_CONVERSION = YES; 345 | CLANG_WARN_COMMA = YES; 346 | CLANG_WARN_CONSTANT_CONVERSION = YES; 347 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 348 | CLANG_WARN_EMPTY_BODY = YES; 349 | CLANG_WARN_ENUM_CONVERSION = YES; 350 | CLANG_WARN_INFINITE_RECURSION = YES; 351 | CLANG_WARN_INT_CONVERSION = YES; 352 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 353 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 354 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 355 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 356 | CLANG_WARN_STRICT_PROTOTYPES = YES; 357 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 358 | CLANG_WARN_UNREACHABLE_CODE = YES; 359 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 360 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 361 | COPY_PHASE_STRIP = NO; 362 | DEBUG_INFORMATION_FORMAT = dwarf; 363 | ENABLE_STRICT_OBJC_MSGSEND = YES; 364 | ENABLE_TESTABILITY = YES; 365 | GCC_C_LANGUAGE_STANDARD = gnu99; 366 | GCC_DYNAMIC_NO_PIC = NO; 367 | GCC_NO_COMMON_BLOCKS = YES; 368 | GCC_OPTIMIZATION_LEVEL = 0; 369 | GCC_PREPROCESSOR_DEFINITIONS = ( 370 | "DEBUG=1", 371 | "$(inherited)", 372 | ); 373 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 374 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 375 | GCC_WARN_UNDECLARED_SELECTOR = YES; 376 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 377 | GCC_WARN_UNUSED_FUNCTION = YES; 378 | GCC_WARN_UNUSED_VARIABLE = YES; 379 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 380 | MTL_ENABLE_DEBUG_INFO = YES; 381 | ONLY_ACTIVE_ARCH = YES; 382 | SDKROOT = iphoneos; 383 | TARGETED_DEVICE_FAMILY = "1,2"; 384 | }; 385 | name = Debug; 386 | }; 387 | 97C147041CF9000F007C117D /* Release */ = { 388 | isa = XCBuildConfiguration; 389 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 390 | buildSettings = { 391 | ALWAYS_SEARCH_USER_PATHS = NO; 392 | CLANG_ANALYZER_NONNULL = YES; 393 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 394 | CLANG_CXX_LIBRARY = "libc++"; 395 | CLANG_ENABLE_MODULES = YES; 396 | CLANG_ENABLE_OBJC_ARC = YES; 397 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 398 | CLANG_WARN_BOOL_CONVERSION = YES; 399 | CLANG_WARN_COMMA = YES; 400 | CLANG_WARN_CONSTANT_CONVERSION = YES; 401 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 402 | CLANG_WARN_EMPTY_BODY = YES; 403 | CLANG_WARN_ENUM_CONVERSION = YES; 404 | CLANG_WARN_INFINITE_RECURSION = YES; 405 | CLANG_WARN_INT_CONVERSION = YES; 406 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 407 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 408 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 409 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 410 | CLANG_WARN_STRICT_PROTOTYPES = YES; 411 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 412 | CLANG_WARN_UNREACHABLE_CODE = YES; 413 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 414 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 415 | COPY_PHASE_STRIP = NO; 416 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 417 | ENABLE_NS_ASSERTIONS = NO; 418 | ENABLE_STRICT_OBJC_MSGSEND = YES; 419 | GCC_C_LANGUAGE_STANDARD = gnu99; 420 | GCC_NO_COMMON_BLOCKS = YES; 421 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 422 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 423 | GCC_WARN_UNDECLARED_SELECTOR = YES; 424 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 425 | GCC_WARN_UNUSED_FUNCTION = YES; 426 | GCC_WARN_UNUSED_VARIABLE = YES; 427 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 428 | MTL_ENABLE_DEBUG_INFO = NO; 429 | SDKROOT = iphoneos; 430 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 431 | TARGETED_DEVICE_FAMILY = "1,2"; 432 | VALIDATE_PRODUCT = YES; 433 | }; 434 | name = Release; 435 | }; 436 | 97C147061CF9000F007C117D /* Debug */ = { 437 | isa = XCBuildConfiguration; 438 | baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; 439 | buildSettings = { 440 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 441 | CLANG_ENABLE_MODULES = YES; 442 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 443 | ENABLE_BITCODE = NO; 444 | FRAMEWORK_SEARCH_PATHS = ( 445 | "$(inherited)", 446 | "$(PROJECT_DIR)/Flutter", 447 | ); 448 | INFOPLIST_FILE = Runner/Info.plist; 449 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 450 | LIBRARY_SEARCH_PATHS = ( 451 | "$(inherited)", 452 | "$(PROJECT_DIR)/Flutter", 453 | ); 454 | PRODUCT_BUNDLE_IDENTIFIER = com.dna.exampleInnerDrawer; 455 | PRODUCT_NAME = "$(TARGET_NAME)"; 456 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; 457 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 458 | SWIFT_SWIFT3_OBJC_INFERENCE = On; 459 | SWIFT_VERSION = 4.0; 460 | VERSIONING_SYSTEM = "apple-generic"; 461 | }; 462 | name = Debug; 463 | }; 464 | 97C147071CF9000F007C117D /* Release */ = { 465 | isa = XCBuildConfiguration; 466 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 467 | buildSettings = { 468 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 469 | CLANG_ENABLE_MODULES = YES; 470 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 471 | ENABLE_BITCODE = NO; 472 | FRAMEWORK_SEARCH_PATHS = ( 473 | "$(inherited)", 474 | "$(PROJECT_DIR)/Flutter", 475 | ); 476 | INFOPLIST_FILE = Runner/Info.plist; 477 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 478 | LIBRARY_SEARCH_PATHS = ( 479 | "$(inherited)", 480 | "$(PROJECT_DIR)/Flutter", 481 | ); 482 | PRODUCT_BUNDLE_IDENTIFIER = com.dna.exampleInnerDrawer; 483 | PRODUCT_NAME = "$(TARGET_NAME)"; 484 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; 485 | SWIFT_SWIFT3_OBJC_INFERENCE = On; 486 | SWIFT_VERSION = 4.0; 487 | VERSIONING_SYSTEM = "apple-generic"; 488 | }; 489 | name = Release; 490 | }; 491 | /* End XCBuildConfiguration section */ 492 | 493 | /* Begin XCConfigurationList section */ 494 | 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { 495 | isa = XCConfigurationList; 496 | buildConfigurations = ( 497 | 97C147031CF9000F007C117D /* Debug */, 498 | 97C147041CF9000F007C117D /* Release */, 499 | 249021D3217E4FDB00AE95B9 /* Profile */, 500 | ); 501 | defaultConfigurationIsVisible = 0; 502 | defaultConfigurationName = Release; 503 | }; 504 | 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { 505 | isa = XCConfigurationList; 506 | buildConfigurations = ( 507 | 97C147061CF9000F007C117D /* Debug */, 508 | 97C147071CF9000F007C117D /* Release */, 509 | 249021D4217E4FDB00AE95B9 /* Profile */, 510 | ); 511 | defaultConfigurationIsVisible = 0; 512 | defaultConfigurationName = Release; 513 | }; 514 | /* End XCConfigurationList section */ 515 | 516 | }; 517 | rootObject = 97C146E61CF9000F007C117D /* Project object */; 518 | } 519 | -------------------------------------------------------------------------------- /example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 31 | 32 | 33 | 34 | 40 | 41 | 42 | 43 | 44 | 45 | 56 | 58 | 64 | 65 | 66 | 67 | 68 | 69 | 75 | 77 | 83 | 84 | 85 | 86 | 88 | 89 | 92 | 93 | 94 | -------------------------------------------------------------------------------- /example/ios/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /example/ios/Runner/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | import Flutter 3 | 4 | @UIApplicationMain 5 | @objc class AppDelegate: FlutterAppDelegate { 6 | override func application( 7 | _ application: UIApplication, 8 | didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]? 9 | ) -> Bool { 10 | GeneratedPluginRegistrant.register(with: self) 11 | return super.application(application, didFinishLaunchingWithOptions: launchOptions) 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "20x20", 5 | "idiom" : "iphone", 6 | "filename" : "Icon-App-20x20@2x.png", 7 | "scale" : "2x" 8 | }, 9 | { 10 | "size" : "20x20", 11 | "idiom" : "iphone", 12 | "filename" : "Icon-App-20x20@3x.png", 13 | "scale" : "3x" 14 | }, 15 | { 16 | "size" : "29x29", 17 | "idiom" : "iphone", 18 | "filename" : "Icon-App-29x29@1x.png", 19 | "scale" : "1x" 20 | }, 21 | { 22 | "size" : "29x29", 23 | "idiom" : "iphone", 24 | "filename" : "Icon-App-29x29@2x.png", 25 | "scale" : "2x" 26 | }, 27 | { 28 | "size" : "29x29", 29 | "idiom" : "iphone", 30 | "filename" : "Icon-App-29x29@3x.png", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "size" : "40x40", 35 | "idiom" : "iphone", 36 | "filename" : "Icon-App-40x40@2x.png", 37 | "scale" : "2x" 38 | }, 39 | { 40 | "size" : "40x40", 41 | "idiom" : "iphone", 42 | "filename" : "Icon-App-40x40@3x.png", 43 | "scale" : "3x" 44 | }, 45 | { 46 | "size" : "60x60", 47 | "idiom" : "iphone", 48 | "filename" : "Icon-App-60x60@2x.png", 49 | "scale" : "2x" 50 | }, 51 | { 52 | "size" : "60x60", 53 | "idiom" : "iphone", 54 | "filename" : "Icon-App-60x60@3x.png", 55 | "scale" : "3x" 56 | }, 57 | { 58 | "size" : "20x20", 59 | "idiom" : "ipad", 60 | "filename" : "Icon-App-20x20@1x.png", 61 | "scale" : "1x" 62 | }, 63 | { 64 | "size" : "20x20", 65 | "idiom" : "ipad", 66 | "filename" : "Icon-App-20x20@2x.png", 67 | "scale" : "2x" 68 | }, 69 | { 70 | "size" : "29x29", 71 | "idiom" : "ipad", 72 | "filename" : "Icon-App-29x29@1x.png", 73 | "scale" : "1x" 74 | }, 75 | { 76 | "size" : "29x29", 77 | "idiom" : "ipad", 78 | "filename" : "Icon-App-29x29@2x.png", 79 | "scale" : "2x" 80 | }, 81 | { 82 | "size" : "40x40", 83 | "idiom" : "ipad", 84 | "filename" : "Icon-App-40x40@1x.png", 85 | "scale" : "1x" 86 | }, 87 | { 88 | "size" : "40x40", 89 | "idiom" : "ipad", 90 | "filename" : "Icon-App-40x40@2x.png", 91 | "scale" : "2x" 92 | }, 93 | { 94 | "size" : "76x76", 95 | "idiom" : "ipad", 96 | "filename" : "Icon-App-76x76@1x.png", 97 | "scale" : "1x" 98 | }, 99 | { 100 | "size" : "76x76", 101 | "idiom" : "ipad", 102 | "filename" : "Icon-App-76x76@2x.png", 103 | "scale" : "2x" 104 | }, 105 | { 106 | "size" : "83.5x83.5", 107 | "idiom" : "ipad", 108 | "filename" : "Icon-App-83.5x83.5@2x.png", 109 | "scale" : "2x" 110 | }, 111 | { 112 | "size" : "1024x1024", 113 | "idiom" : "ios-marketing", 114 | "filename" : "Icon-App-1024x1024@1x.png", 115 | "scale" : "1x" 116 | } 117 | ], 118 | "info" : { 119 | "version" : 1, 120 | "author" : "xcode" 121 | } 122 | } 123 | -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dn-a/flutter_inner_drawer/9dbe02e648dd9db8ec018a0ce4b1ca3839cbc0b3/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dn-a/flutter_inner_drawer/9dbe02e648dd9db8ec018a0ce4b1ca3839cbc0b3/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dn-a/flutter_inner_drawer/9dbe02e648dd9db8ec018a0ce4b1ca3839cbc0b3/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dn-a/flutter_inner_drawer/9dbe02e648dd9db8ec018a0ce4b1ca3839cbc0b3/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dn-a/flutter_inner_drawer/9dbe02e648dd9db8ec018a0ce4b1ca3839cbc0b3/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dn-a/flutter_inner_drawer/9dbe02e648dd9db8ec018a0ce4b1ca3839cbc0b3/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dn-a/flutter_inner_drawer/9dbe02e648dd9db8ec018a0ce4b1ca3839cbc0b3/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dn-a/flutter_inner_drawer/9dbe02e648dd9db8ec018a0ce4b1ca3839cbc0b3/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dn-a/flutter_inner_drawer/9dbe02e648dd9db8ec018a0ce4b1ca3839cbc0b3/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dn-a/flutter_inner_drawer/9dbe02e648dd9db8ec018a0ce4b1ca3839cbc0b3/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dn-a/flutter_inner_drawer/9dbe02e648dd9db8ec018a0ce4b1ca3839cbc0b3/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dn-a/flutter_inner_drawer/9dbe02e648dd9db8ec018a0ce4b1ca3839cbc0b3/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dn-a/flutter_inner_drawer/9dbe02e648dd9db8ec018a0ce4b1ca3839cbc0b3/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dn-a/flutter_inner_drawer/9dbe02e648dd9db8ec018a0ce4b1ca3839cbc0b3/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dn-a/flutter_inner_drawer/9dbe02e648dd9db8ec018a0ce4b1ca3839cbc0b3/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "LaunchImage.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "LaunchImage@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "LaunchImage@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dn-a/flutter_inner_drawer/9dbe02e648dd9db8ec018a0ce4b1ca3839cbc0b3/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dn-a/flutter_inner_drawer/9dbe02e648dd9db8ec018a0ce4b1ca3839cbc0b3/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dn-a/flutter_inner_drawer/9dbe02e648dd9db8ec018a0ce4b1ca3839cbc0b3/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md: -------------------------------------------------------------------------------- 1 | # Launch Screen Assets 2 | 3 | You can customize the launch screen with your own desired assets by replacing the image files in this directory. 4 | 5 | You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images. -------------------------------------------------------------------------------- /example/ios/Runner/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /example/ios/Runner/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /example/ios/Runner/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | example_inner_drawer 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | $(FLUTTER_BUILD_NAME) 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | $(FLUTTER_BUILD_NUMBER) 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UISupportedInterfaceOrientations 30 | 31 | UIInterfaceOrientationPortrait 32 | UIInterfaceOrientationLandscapeLeft 33 | UIInterfaceOrientationLandscapeRight 34 | 35 | UISupportedInterfaceOrientations~ipad 36 | 37 | UIInterfaceOrientationPortrait 38 | UIInterfaceOrientationPortraitUpsideDown 39 | UIInterfaceOrientationLandscapeLeft 40 | UIInterfaceOrientationLandscapeRight 41 | 42 | UIViewControllerBasedStatusBarAppearance 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /example/ios/Runner/Runner-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | #import "GeneratedPluginRegistrant.h" -------------------------------------------------------------------------------- /example/lib/children/left_child_1.dart: -------------------------------------------------------------------------------- 1 | import 'dart:ui'; 2 | import 'package:example/notifier/drawer_notifier.dart'; 3 | import 'package:flutter/material.dart'; 4 | import 'package:provider/provider.dart'; 5 | 6 | class LeftChild extends StatelessWidget { 7 | LeftChild({Key key}) : super(key: key); 8 | 9 | @override 10 | Widget build(BuildContext context) { 11 | print("build left"); 12 | 13 | final double swipeOffset = 14 | context.select((DrawerNotifier value) => value.swipeOffset); 15 | return Material( 16 | child: Stack( 17 | children: [ 18 | Container( 19 | decoration: BoxDecoration( 20 | gradient: LinearGradient( 21 | begin: Alignment.topRight, 22 | end: Alignment.bottomLeft, 23 | // Add one stop for each color. Stops should increase from 0 to 1 24 | //stops: [0.1, 0.5,0.5, 0.7, 0.9], 25 | colors: [ 26 | ColorTween( 27 | begin: Colors.blueAccent, 28 | end: Colors.blueGrey[400].withRed(100), 29 | ).lerp(swipeOffset), 30 | ColorTween( 31 | begin: Colors.green, 32 | end: Colors.blueGrey[800].withGreen(80), 33 | ).lerp(swipeOffset), 34 | ], 35 | ), 36 | ), 37 | child: Stack( 38 | children: [ 39 | Padding( 40 | padding: EdgeInsets.only(left: 30), 41 | child: Column( 42 | crossAxisAlignment: CrossAxisAlignment.start, 43 | mainAxisAlignment: MainAxisAlignment.center, 44 | children: [ 45 | Column( 46 | children: [ 47 | Container( 48 | margin: EdgeInsets.only(left: 10, bottom: 15), 49 | width: 80, 50 | child: ClipRRect( 51 | child: Image.network( 52 | "https://img.icons8.com/officel/2x/user.png", 53 | ), 54 | borderRadius: BorderRadius.circular(50), 55 | ), 56 | ), 57 | Text( 58 | "User", 59 | style: TextStyle(color: Colors.white, fontSize: 18), 60 | ) 61 | ], 62 | //mainAxisAlignment: MainAxisAlignment.center, 63 | ), 64 | Padding( 65 | padding: EdgeInsets.all(10), 66 | ), 67 | ListTile( 68 | onTap: () => print("Dashboard"), 69 | title: Text( 70 | "Dashboard", 71 | style: TextStyle(color: Colors.white, fontSize: 14), 72 | ), 73 | leading: Icon( 74 | Icons.dashboard, 75 | color: Colors.white, 76 | size: 22, 77 | ), 78 | ), 79 | ListTile( 80 | title: Text( 81 | "Nametag", 82 | style: TextStyle(fontSize: 14), 83 | ), 84 | leading: Icon( 85 | Icons.rounded_corner, 86 | size: 22, 87 | ), 88 | ), 89 | ListTile( 90 | title: Text( 91 | "Favorite", 92 | style: TextStyle(fontSize: 14), 93 | ), 94 | leading: Icon( 95 | Icons.bookmark_border, 96 | size: 22, 97 | ), 98 | ), 99 | ListTile( 100 | title: Text( 101 | "Close Friends", 102 | style: TextStyle(fontSize: 14), 103 | ), 104 | leading: Icon( 105 | Icons.list, 106 | size: 22, 107 | ), 108 | ), 109 | ListTile( 110 | title: Text( 111 | "Suggested People", 112 | style: TextStyle(fontSize: 14), 113 | ), 114 | leading: Icon( 115 | Icons.person_add, 116 | size: 22, 117 | ), 118 | ), 119 | ], 120 | ), 121 | ), 122 | Positioned( 123 | bottom: 0, 124 | child: Container( 125 | alignment: Alignment.bottomLeft, 126 | margin: EdgeInsets.only(top: 50), 127 | padding: EdgeInsets.symmetric(vertical: 15, horizontal: 25), 128 | width: double.maxFinite, 129 | child: Row( 130 | mainAxisAlignment: MainAxisAlignment.start, 131 | children: [ 132 | Icon( 133 | Icons.all_out, 134 | size: 18, 135 | color: Colors.grey, 136 | ), 137 | Text( 138 | " LogOut", 139 | style: TextStyle( 140 | fontSize: 16, 141 | color: Colors.grey, 142 | ), 143 | ), 144 | ], 145 | ), 146 | ), 147 | ) 148 | ], 149 | ), 150 | ), 151 | swipeOffset < 1 152 | ? BackdropFilter( 153 | filter: ImageFilter.blur( 154 | sigmaX: (10 - swipeOffset * 10), 155 | sigmaY: (10 - swipeOffset * 10)), 156 | child: Container( 157 | decoration: BoxDecoration( 158 | color: Colors.black.withOpacity(0), 159 | ), 160 | ), 161 | ) 162 | : null, 163 | ].where((a) => a != null).toList(), 164 | )); 165 | } 166 | } 167 | -------------------------------------------------------------------------------- /example/lib/children/right_child_1.dart: -------------------------------------------------------------------------------- 1 | import 'dart:ui'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:flutter_inner_drawer/inner_drawer.dart'; 4 | import '../env.dart'; 5 | 6 | class RightChild extends StatelessWidget { 7 | final bool _position = true; 8 | final GlobalKey innerDrawerKey; 9 | RightChild({this.innerDrawerKey, Key key}) : super(key: key); 10 | 11 | @override 12 | Widget build(BuildContext context) { 13 | print("build right"); 14 | 15 | return Material( 16 | child: SafeArea( 17 | //top: false, 18 | right: false, 19 | left: false, 20 | child: Container( 21 | decoration: BoxDecoration( 22 | border: Border( 23 | left: BorderSide(width: 1, color: Colors.grey[200]), 24 | right: BorderSide(width: 1, color: Colors.grey[200])), 25 | ), 26 | child: Stack( 27 | children: [ 28 | ListView( 29 | children: [ 30 | Padding( 31 | padding: 32 | EdgeInsets.only(top: 12, bottom: 4, left: 15), 33 | child: Row( 34 | mainAxisAlignment: MainAxisAlignment.spaceBetween, 35 | children: [ 36 | Row( 37 | children: [ 38 | SizedBox( 39 | width: 15, 40 | height: 15, 41 | child: CircleAvatar( 42 | child: Icon(Icons.person, 43 | color: Colors.white, size: 12), 44 | backgroundColor: Colors.grey, 45 | ), 46 | ), 47 | Text( 48 | " Guest", 49 | style: TextStyle( 50 | fontWeight: FontWeight.w600, 51 | height: 1.2), 52 | ), 53 | ], 54 | ), 55 | Padding( 56 | padding: EdgeInsets.only(top: 2, right: 25), 57 | child: GestureDetector( 58 | child: Icon( 59 | _position 60 | ? Icons.arrow_back 61 | : Icons.arrow_forward, 62 | size: 18, 63 | ), 64 | onTap: () { 65 | innerDrawerKey.currentState.toggle(); 66 | }, 67 | ), 68 | ), 69 | ], 70 | )), 71 | Divider(), 72 | ListTile( 73 | title: Text("Statistics"), 74 | leading: Icon(Icons.show_chart), 75 | ), 76 | ListTile( 77 | title: Text("Activity"), 78 | leading: Icon(Icons.access_time), 79 | ), 80 | ListTile( 81 | title: Text("Nametag"), 82 | leading: Icon(Icons.rounded_corner), 83 | ), 84 | ListTile( 85 | title: Text("Favorite"), 86 | leading: Icon(Icons.bookmark_border), 87 | ), 88 | ListTile( 89 | title: Text("Close Friends"), 90 | leading: Icon(Icons.list), 91 | ), 92 | ListTile( 93 | title: Text("Suggested People"), 94 | leading: Icon(Icons.person_add), 95 | ), 96 | ListTile( 97 | title: Text("Open Facebook"), 98 | leading: Icon( 99 | Env.facebook_icon, 100 | size: 18, 101 | ), 102 | ), 103 | Container( 104 | alignment: Alignment.bottomLeft, 105 | margin: EdgeInsets.only(top: 50), 106 | padding: 107 | EdgeInsets.symmetric(vertical: 15, horizontal: 25), 108 | //width: double.maxFinite, 109 | decoration: BoxDecoration( 110 | //color: Colors.grey, 111 | border: Border( 112 | top: BorderSide( 113 | color: Colors.grey[300], 114 | ))), 115 | child: Row( 116 | mainAxisAlignment: MainAxisAlignment.start, 117 | children: [ 118 | Icon( 119 | Icons.settings, 120 | size: 18, 121 | ), 122 | Text( 123 | " Settings", 124 | style: TextStyle(fontSize: 16), 125 | ), 126 | ], 127 | ), 128 | ) 129 | ], 130 | ), 131 | ], 132 | ), 133 | ))); 134 | } 135 | } 136 | -------------------------------------------------------------------------------- /example/lib/env.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class Env { 4 | static final facebook_icon = IconData(0xea94, fontFamily: 'icon'); 5 | } 6 | -------------------------------------------------------------------------------- /example/lib/example_1.dart: -------------------------------------------------------------------------------- 1 | import 'dart:ui'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:flutter_inner_drawer/inner_drawer.dart'; 4 | import 'package:provider/provider.dart'; 5 | 6 | import 'children/left_child_1.dart'; 7 | import 'notifier/drawer_notifier.dart'; 8 | import 'children/right_child_1.dart'; 9 | import 'scaffolds/scaffolds_1.dart'; 10 | 11 | class ExampleOne extends StatelessWidget { 12 | final GlobalKey _innerDrawerKey = 13 | GlobalKey(); 14 | 15 | String _title = "One"; 16 | 17 | Color pickerColor = Color(0xff443a49); 18 | Color currentColor = Colors.black54; 19 | ValueChanged onColorChanged; 20 | 21 | @override 22 | Widget build(BuildContext context) { 23 | print("example 1"); 24 | //final drawerNotifier = Provider.of(context, listen: true); 25 | 26 | return InnerDrawer( 27 | key: _innerDrawerKey, 28 | onTapClose: context.select((DrawerNotifier value) => value.onTapToClose), 29 | tapScaffoldEnabled: 30 | context.select((DrawerNotifier value) => value.tapScaffold), 31 | velocity: 20, 32 | swipeChild: true, 33 | offset: IDOffset.horizontal( 34 | context.select((DrawerNotifier value) => value.offset)), 35 | swipe: context.select((DrawerNotifier value) => value.swipe), 36 | colorTransitionChild: 37 | context.select((DrawerNotifier value) => value.colorTransition), 38 | colorTransitionScaffold: 39 | context.select((DrawerNotifier value) => value.colorTransition), 40 | leftAnimationType: 41 | context.select((DrawerNotifier value) => value.animationType), 42 | rightAnimationType: InnerDrawerAnimation.linear, 43 | 44 | leftChild: LeftChild(), 45 | 46 | rightChild: RightChild(innerDrawerKey: _innerDrawerKey), 47 | 48 | scaffold: ScaffoldDrawer(innerDrawerKey: _innerDrawerKey), 49 | 50 | onDragUpdate: (double value, InnerDrawerDirection direction) { 51 | //BAD: DO NOT DO THIS, take it as a general example. 52 | // We working to find a solution. 53 | //drawerNotifier.setSwipeOffset(value); 54 | context.read().setSwipeOffset(value); 55 | }, 56 | //innerDrawerCallback: (a) => print(a), 57 | ); 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /example/lib/example_2.dart: -------------------------------------------------------------------------------- 1 | import 'package:example/env.dart'; 2 | import 'package:flutter/cupertino.dart'; 3 | import 'package:flutter/material.dart'; 4 | import 'package:flutter/services.dart'; 5 | import 'package:flutter_inner_drawer/inner_drawer.dart'; 6 | 7 | import 'package:flutter_colorpicker/flutter_colorpicker.dart'; 8 | 9 | class ExampleTwo extends StatefulWidget { 10 | ExampleTwo({Key key}) : super(key: key); 11 | 12 | @override 13 | _ExampleTwoState createState() => _ExampleTwoState(); 14 | } 15 | 16 | class _ExampleTwoState extends State { 17 | final GlobalKey _innerDrawerKey = 18 | GlobalKey(); 19 | 20 | GlobalKey _keyRed = GlobalKey(); 21 | double _width = 10; 22 | 23 | bool _onTapToClose = false; 24 | bool _swipe = true; 25 | bool _tapScaffold = true; 26 | InnerDrawerAnimation _animationType = InnerDrawerAnimation.static; 27 | bool _proportionalChildArea = true; 28 | double _horizontalOffset = 0.4; 29 | double _verticalOffset = 0.4; 30 | bool _topBottom = false; 31 | double _scale = 0.9; 32 | double _borderRadius = 50; 33 | 34 | AnimationController _animationController; 35 | Animation _bkgColor; 36 | 37 | String _title = "Two"; 38 | 39 | @override 40 | void initState() { 41 | _getwidthContainer(); 42 | super.initState(); 43 | } 44 | 45 | @override 46 | void dispose() { 47 | super.dispose(); 48 | } 49 | 50 | Color currentColor = Colors.black54; 51 | 52 | void _getwidthContainer() { 53 | WidgetsBinding.instance.addPostFrameCallback((_) { 54 | final keyContext = _keyRed.currentContext; 55 | if (keyContext != null) { 56 | final RenderBox box = keyContext.findRenderObject(); 57 | final size = box.size; 58 | setState(() { 59 | _width = size.width; 60 | }); 61 | } 62 | }); 63 | } 64 | 65 | @override 66 | Widget build(BuildContext context) { 67 | return InnerDrawer( 68 | key: _innerDrawerKey, 69 | onTapClose: true, 70 | offset: IDOffset.only( 71 | top: _topBottom ? _verticalOffset : 0.0, 72 | bottom: !_topBottom ? _verticalOffset : 0.0, 73 | right: _horizontalOffset, 74 | left: _horizontalOffset), 75 | scale: IDOffset.horizontal(_scale), 76 | borderRadius: _borderRadius, 77 | duration: Duration(milliseconds: 11200), 78 | swipe: _swipe, 79 | proportionalChildArea: _proportionalChildArea, 80 | //backgroundColor: Colors.red, 81 | colorTransitionChild: currentColor, 82 | leftAnimationType: _animationType, 83 | rightAnimationType: _animationType, 84 | leftChild: Material( 85 | color: Theme.of(context).backgroundColor, 86 | child: Center( 87 | child: Container( 88 | child: Text( 89 | "Left Child", 90 | style: TextStyle(fontSize: 18), 91 | ), 92 | ), 93 | )), 94 | rightChild: Material( 95 | color: Theme.of(context).backgroundColor, 96 | child: Center( 97 | child: Container( 98 | child: Text( 99 | "Right Child", 100 | style: TextStyle(fontSize: 18), 101 | ), 102 | ), 103 | )), 104 | scaffold: Container( 105 | width: double.infinity, 106 | padding: EdgeInsets.symmetric(vertical: 30), 107 | decoration: BoxDecoration( 108 | gradient: LinearGradient( 109 | begin: Alignment.topCenter, 110 | end: Alignment.bottomLeft, 111 | //stops: [0.1, 0.5,0.5, 0.7, 0.9], 112 | colors: [ 113 | Colors.orange, 114 | Colors.red, 115 | ], 116 | ), 117 | ), 118 | child: SafeArea( 119 | child: Material( 120 | color: Colors.transparent, 121 | child: Column( 122 | crossAxisAlignment: CrossAxisAlignment.center, 123 | children: [ 124 | Row( 125 | mainAxisAlignment: MainAxisAlignment.center, 126 | children: [ 127 | GestureDetector( 128 | child: Row( 129 | children: [ 130 | Text('Static'), 131 | Checkbox( 132 | activeColor: Colors.black, 133 | value: 134 | _animationType == InnerDrawerAnimation.static, 135 | onChanged: (a) { 136 | setState(() { 137 | _animationType = InnerDrawerAnimation.static; 138 | }); 139 | }), 140 | ], 141 | ), 142 | onTap: () { 143 | setState(() { 144 | _animationType = InnerDrawerAnimation.static; 145 | }); 146 | }, 147 | ), 148 | GestureDetector( 149 | child: Row( 150 | mainAxisAlignment: MainAxisAlignment.center, 151 | children: [ 152 | Checkbox( 153 | activeColor: Colors.black, 154 | value: 155 | _animationType == InnerDrawerAnimation.linear, 156 | onChanged: (a) { 157 | setState(() { 158 | _animationType = InnerDrawerAnimation.linear; 159 | }); 160 | }), 161 | Text('Linear'), 162 | ], 163 | ), 164 | onTap: () { 165 | setState(() { 166 | _animationType = InnerDrawerAnimation.linear; 167 | }); 168 | }, 169 | ), 170 | GestureDetector( 171 | child: Row( 172 | mainAxisAlignment: MainAxisAlignment.center, 173 | children: [ 174 | Checkbox( 175 | activeColor: Colors.black, 176 | value: _animationType == 177 | InnerDrawerAnimation.quadratic, 178 | onChanged: (a) { 179 | setState(() { 180 | _animationType = 181 | InnerDrawerAnimation.quadratic; 182 | }); 183 | }), 184 | Text('Quadratic'), 185 | ], 186 | ), 187 | onTap: () { 188 | setState(() { 189 | _animationType = InnerDrawerAnimation.quadratic; 190 | }); 191 | }, 192 | ), 193 | ], 194 | ), 195 | Padding( 196 | padding: EdgeInsets.all(10), 197 | ), 198 | GestureDetector( 199 | child: Row( 200 | mainAxisAlignment: MainAxisAlignment.center, 201 | children: [ 202 | Checkbox( 203 | activeColor: Colors.black, 204 | value: _proportionalChildArea == true, 205 | onChanged: (a) { 206 | setState(() { 207 | _proportionalChildArea = !_proportionalChildArea; 208 | }); 209 | }), 210 | Text('ProportionalChildArea'), 211 | ], 212 | ), 213 | onTap: () { 214 | setState(() { 215 | _proportionalChildArea = !_proportionalChildArea; 216 | }); 217 | }, 218 | ), 219 | Padding( 220 | padding: EdgeInsets.all(10), 221 | ), 222 | Column( 223 | children: [ 224 | Text('Horizontal Offset'), 225 | Row( 226 | mainAxisAlignment: MainAxisAlignment.center, 227 | children: [ 228 | SliderTheme( 229 | data: Theme.of(context).sliderTheme.copyWith( 230 | valueIndicatorTextStyle: Theme.of(context) 231 | .accentTextTheme 232 | .body2 233 | .copyWith(color: Colors.white), 234 | ), 235 | child: Slider( 236 | activeColor: Colors.black, 237 | //inactiveColor: Colors.white, 238 | value: _horizontalOffset, 239 | min: 0.0, 240 | max: 1, 241 | divisions: 5, 242 | semanticFormatterCallback: (double value) => 243 | value.round().toString(), 244 | label: '$_horizontalOffset', 245 | onChanged: (a) { 246 | setState(() { 247 | _horizontalOffset = a; 248 | }); 249 | }, 250 | onChangeEnd: (a) { 251 | //_getwidthContainer(); 252 | }, 253 | ), 254 | ), 255 | Text(_horizontalOffset.toString()), 256 | //Text(_fontSize.toString()), 257 | ], 258 | ), 259 | ], 260 | ), 261 | Padding( 262 | padding: EdgeInsets.all(10), 263 | ), 264 | Column( 265 | children: [ 266 | Text('Vertical Offset'), 267 | Row( 268 | mainAxisAlignment: MainAxisAlignment.center, 269 | children: [ 270 | GestureDetector( 271 | child: Row( 272 | mainAxisAlignment: MainAxisAlignment.center, 273 | children: [ 274 | Checkbox( 275 | activeColor: Colors.black, 276 | value: _topBottom == true, 277 | onChanged: (a) { 278 | setState(() { 279 | _topBottom = true; 280 | }); 281 | }), 282 | Text('Top'), 283 | ], 284 | ), 285 | onTap: () { 286 | setState(() { 287 | _topBottom = true; 288 | }); 289 | }, 290 | ), 291 | GestureDetector( 292 | child: Row( 293 | mainAxisAlignment: MainAxisAlignment.center, 294 | children: [ 295 | Checkbox( 296 | activeColor: Colors.black, 297 | value: _topBottom == false, 298 | onChanged: (a) { 299 | setState(() { 300 | _topBottom = false; 301 | }); 302 | }), 303 | Text('Bottom'), 304 | ], 305 | ), 306 | onTap: () { 307 | setState(() { 308 | _topBottom = false; 309 | }); 310 | }, 311 | ), 312 | ], 313 | ), 314 | Row( 315 | mainAxisAlignment: MainAxisAlignment.center, 316 | children: [ 317 | SliderTheme( 318 | data: Theme.of(context).sliderTheme.copyWith( 319 | valueIndicatorTextStyle: Theme.of(context) 320 | .accentTextTheme 321 | .body2 322 | .copyWith(color: Colors.white), 323 | ), 324 | child: Slider( 325 | activeColor: Colors.black, 326 | //inactiveColor: Colors.white, 327 | value: _verticalOffset, 328 | min: 0.0, 329 | max: 1, 330 | divisions: 5, 331 | semanticFormatterCallback: (double value) => 332 | value.round().toString(), 333 | label: '$_verticalOffset', 334 | onChanged: (a) { 335 | setState(() { 336 | _verticalOffset = a; 337 | }); 338 | }, 339 | onChangeEnd: (a) { 340 | //_getwidthContainer(); 341 | }, 342 | ), 343 | ), 344 | Text(_verticalOffset.toString()), 345 | //Text(_fontSize.toString()), 346 | ], 347 | ), 348 | ], 349 | ), 350 | Padding( 351 | padding: EdgeInsets.all(10), 352 | ), 353 | Column( 354 | children: [ 355 | Text('Scale'), 356 | Row( 357 | mainAxisAlignment: MainAxisAlignment.center, 358 | children: [ 359 | SliderTheme( 360 | data: Theme.of(context).sliderTheme.copyWith( 361 | valueIndicatorTextStyle: Theme.of(context) 362 | .accentTextTheme 363 | .body2 364 | .copyWith(color: Colors.white), 365 | ), 366 | child: Slider( 367 | activeColor: Colors.black, 368 | //inactiveColor: Colors.white, 369 | value: _scale, 370 | min: 0.0, 371 | max: 1, 372 | divisions: 10, 373 | semanticFormatterCallback: (double value) => 374 | value.round().toString(), 375 | label: '$_scale', 376 | onChanged: (a) { 377 | setState(() { 378 | _scale = a; 379 | }); 380 | }, 381 | ), 382 | ), 383 | Text(_scale.toString()), 384 | //Text(_fontSize.toString()), 385 | ], 386 | ), 387 | ], 388 | ), 389 | Padding( 390 | padding: EdgeInsets.all(10), 391 | ), 392 | Column( 393 | children: [ 394 | Text('Border Radius'), 395 | Row( 396 | mainAxisAlignment: MainAxisAlignment.center, 397 | children: [ 398 | SliderTheme( 399 | data: Theme.of(context).sliderTheme.copyWith( 400 | valueIndicatorTextStyle: Theme.of(context) 401 | .accentTextTheme 402 | .body2 403 | .copyWith(color: Colors.white), 404 | ), 405 | child: Slider( 406 | activeColor: Colors.black, 407 | //inactiveColor: Colors.white, 408 | value: _borderRadius, 409 | min: 0, 410 | max: 100, 411 | divisions: 4, 412 | semanticFormatterCallback: (double value) => 413 | value.round().toString(), 414 | label: '$_borderRadius', 415 | onChanged: (a) { 416 | setState(() { 417 | _borderRadius = a; 418 | }); 419 | }, 420 | ), 421 | ), 422 | Text(_borderRadius.toString()), 423 | //Text(_fontSize.toString()), 424 | ], 425 | ), 426 | ], 427 | ), 428 | ], 429 | ), 430 | ), 431 | ), 432 | ), 433 | ); 434 | } 435 | } 436 | -------------------------------------------------------------------------------- /example/lib/example_3.dart: -------------------------------------------------------------------------------- 1 | import 'dart:math'; 2 | 3 | import 'package:example/env.dart'; 4 | import 'package:flutter/cupertino.dart'; 5 | import 'package:flutter/material.dart'; 6 | import 'package:flutter/services.dart'; 7 | import 'package:flutter_inner_drawer/inner_drawer.dart'; 8 | 9 | import 'package:flutter_colorpicker/flutter_colorpicker.dart'; 10 | 11 | class ExampleThree extends StatefulWidget { 12 | ExampleThree({Key key}) : super(key: key); 13 | 14 | @override 15 | _ExampleThreeState createState() => _ExampleThreeState(); 16 | } 17 | 18 | class _ExampleThreeState extends State { 19 | final GlobalKey _innerDrawerKey = 20 | GlobalKey(); 21 | 22 | GlobalKey _keyRed = GlobalKey(); 23 | double _width = 10; 24 | 25 | double _borderRadius = 50; 26 | 27 | AnimationController _animationController; 28 | Animation _bkgColor; 29 | 30 | String _title = "Three"; 31 | 32 | @override 33 | void initState() { 34 | _getwidthContainer(); 35 | myFocusNode = FocusNode(); 36 | myFocusNode2 = FocusNode(); 37 | super.initState(); 38 | } 39 | 40 | @override 41 | void dispose() { 42 | myFocusNode.dispose(); 43 | myFocusNode2.dispose(); 44 | super.dispose(); 45 | } 46 | 47 | Color currentColor = Colors.black54; 48 | 49 | void _getwidthContainer() { 50 | WidgetsBinding.instance.addPostFrameCallback((_) { 51 | final keyContext = _keyRed.currentContext; 52 | if (keyContext != null) { 53 | final RenderBox box = keyContext.findRenderObject(); 54 | final size = box.size; 55 | setState(() { 56 | _width = size.width; 57 | }); 58 | } 59 | }); 60 | } 61 | 62 | FocusNode myFocusNode; 63 | FocusNode myFocusNode2; 64 | 65 | @override 66 | Widget build(BuildContext context) { 67 | return InnerDrawer( 68 | key: _innerDrawerKey, 69 | onTapClose: true, 70 | //tapScaffoldEnabled: true, 71 | borderRadius: _borderRadius, 72 | swipeChild: true, 73 | leftAnimationType: InnerDrawerAnimation.quadratic, 74 | leftChild: Material( 75 | color: Theme.of(context).backgroundColor, 76 | child: Center( 77 | child: Container( 78 | child: Column( 79 | mainAxisAlignment: MainAxisAlignment.center, 80 | children: [ 81 | Text( 82 | "Left Child", 83 | style: TextStyle(fontSize: 18), 84 | ), 85 | TextField( 86 | focusNode: myFocusNode2, 87 | ), 88 | /*ListView.builder( 89 | itemCount: 5, 90 | itemBuilder:(BuildContext context, int index){ 91 | return ListTile(title: Text('test $index'),); 92 | }, 93 | )*/ 94 | ], 95 | )), 96 | )), 97 | scaffold: Container( 98 | width: double.infinity, 99 | padding: EdgeInsets.symmetric(vertical: 30), 100 | decoration: BoxDecoration( 101 | gradient: LinearGradient( 102 | begin: Alignment.topCenter, 103 | end: Alignment.bottomLeft, 104 | //stops: [0.1, 0.5,0.5, 0.7, 0.9], 105 | colors: [ 106 | Colors.green[200], 107 | Colors.green[500], 108 | ], 109 | ), 110 | ), 111 | child: SafeArea( 112 | child: Material( 113 | color: Colors.transparent, 114 | child: Container( 115 | height: double.infinity, 116 | padding: EdgeInsets.all(15), 117 | child: Column( 118 | children: [ 119 | TextField( 120 | focusNode: myFocusNode, 121 | ), 122 | TextField( 123 | // focusNode: myFocusNode, 124 | ), 125 | ], 126 | )), 127 | ), 128 | ), 129 | ), 130 | innerDrawerCallback: (a) { 131 | print(a); 132 | if (a) { 133 | myFocusNode2.requestFocus(); 134 | } else { 135 | myFocusNode.requestFocus(); 136 | } 137 | }, 138 | ); 139 | } 140 | } 141 | -------------------------------------------------------------------------------- /example/lib/generated/i18n.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | 3 | import 'package:flutter/foundation.dart'; 4 | import 'package:flutter/material.dart'; 5 | 6 | // ignore_for_file: non_constant_identifier_names 7 | // ignore_for_file: camel_case_types 8 | // ignore_for_file: prefer_single_quotes 9 | 10 | //This file is automatically generated. DO NOT EDIT, all your changes would be lost. 11 | class S implements WidgetsLocalizations { 12 | const S(); 13 | 14 | static const GeneratedLocalizationsDelegate delegate = 15 | GeneratedLocalizationsDelegate(); 16 | 17 | static S of(BuildContext context) => Localizations.of(context, S); 18 | 19 | @override 20 | TextDirection get textDirection => TextDirection.ltr; 21 | } 22 | 23 | class $en extends S { 24 | const $en(); 25 | } 26 | 27 | class GeneratedLocalizationsDelegate extends LocalizationsDelegate { 28 | const GeneratedLocalizationsDelegate(); 29 | 30 | List get supportedLocales { 31 | return const [ 32 | Locale("en", ""), 33 | ]; 34 | } 35 | 36 | LocaleListResolutionCallback listResolution({Locale fallback}) { 37 | return (List locales, Iterable supported) { 38 | if (locales == null || locales.isEmpty) { 39 | return fallback ?? supported.first; 40 | } else { 41 | return _resolve(locales.first, fallback, supported); 42 | } 43 | }; 44 | } 45 | 46 | LocaleResolutionCallback resolution({Locale fallback}) { 47 | return (Locale locale, Iterable supported) { 48 | return _resolve(locale, fallback, supported); 49 | }; 50 | } 51 | 52 | Locale _resolve(Locale locale, Locale fallback, Iterable supported) { 53 | if (locale == null || !isSupported(locale)) { 54 | return fallback ?? supported.first; 55 | } 56 | 57 | final Locale languageLocale = Locale(locale.languageCode, ""); 58 | if (supported.contains(locale)) { 59 | return locale; 60 | } else if (supported.contains(languageLocale)) { 61 | return languageLocale; 62 | } else { 63 | final Locale fallbackLocale = fallback ?? supported.first; 64 | return fallbackLocale; 65 | } 66 | } 67 | 68 | @override 69 | Future load(Locale locale) { 70 | final String lang = getLang(locale); 71 | if (lang != null) { 72 | switch (lang) { 73 | case "en": 74 | return SynchronousFuture(const $en()); 75 | default: 76 | // NO-OP. 77 | } 78 | } 79 | return SynchronousFuture(const S()); 80 | } 81 | 82 | @override 83 | bool isSupported(Locale locale) => 84 | locale != null && supportedLocales.contains(locale); 85 | 86 | @override 87 | bool shouldReload(GeneratedLocalizationsDelegate old) => false; 88 | } 89 | 90 | String getLang(Locale l) => l == null 91 | ? null 92 | : l.countryCode != null && l.countryCode.isEmpty 93 | ? l.languageCode 94 | : l.toString(); 95 | -------------------------------------------------------------------------------- /example/lib/main.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter/services.dart'; 3 | import 'package:provider/provider.dart'; 4 | 5 | import 'example_1.dart'; 6 | import 'example_2.dart'; 7 | import 'example_3.dart'; 8 | import 'notifier/drawer_notifier.dart'; 9 | 10 | void main() => runApp(ChangeNotifierProvider( 11 | create: (context) => DrawerNotifier(), 12 | child: MyApp(), 13 | )); 14 | 15 | class MyApp extends StatelessWidget { 16 | @override 17 | Widget build(BuildContext context) { 18 | return MaterialApp( 19 | title: 'Inner Drawer', 20 | theme: ThemeData( 21 | primarySwatch: Colors.blueGrey, 22 | backgroundColor: Colors.white, 23 | ), 24 | home: MainApp(), 25 | ); 26 | } 27 | } 28 | 29 | enum Example { one, two, three } 30 | 31 | class MainApp extends StatefulWidget { 32 | MainApp({Key key}) : super(key: key); 33 | 34 | @override 35 | _MainAppState createState() => _MainAppState(); 36 | } 37 | 38 | class _MainAppState extends State with SingleTickerProviderStateMixin { 39 | bool isOpened = false; 40 | AnimationController _animationController; 41 | Animation _buttonColor; 42 | Animation _animateIcon; 43 | Animation _translateButton; 44 | Curve _curve = Curves.easeOut; 45 | double _fabHeight = 56.0; 46 | 47 | Example _currentExample = Example.one; 48 | 49 | @override 50 | initState() { 51 | super.initState(); 52 | 53 | SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle( 54 | //systemNavigationBarColor: Colors.blue, 55 | statusBarColor: Colors.transparent, 56 | //statusBarBrightness: Brightness.dark, 57 | )); 58 | 59 | _animationController = 60 | AnimationController(vsync: this, duration: Duration(milliseconds: 500)) 61 | ..addListener(() { 62 | setState(() {}); 63 | }); 64 | _animateIcon = 65 | Tween(begin: 0.0, end: 1.0).animate(_animationController); 66 | _buttonColor = ColorTween( 67 | begin: Colors.black45, 68 | end: Colors.red, 69 | ).animate(CurvedAnimation( 70 | parent: _animationController, 71 | curve: Interval( 72 | 0.00, 73 | 1.00, 74 | curve: Curves.linear, 75 | ), 76 | )); 77 | _translateButton = Tween( 78 | begin: _fabHeight, 79 | end: -14.0, 80 | ).animate(CurvedAnimation( 81 | parent: _animationController, 82 | curve: Interval( 83 | 0.0, 84 | 0.75, 85 | curve: _curve, 86 | ), 87 | )); 88 | } 89 | 90 | @override 91 | void dispose() { 92 | _animationController.dispose(); 93 | super.dispose(); 94 | } 95 | 96 | @override 97 | Widget build(BuildContext context) { 98 | return Stack( 99 | children: [ 100 | _switchWidget(_currentExample), 101 | Container( 102 | padding: EdgeInsets.all(20), 103 | alignment: Alignment.bottomRight, 104 | child: Column( 105 | mainAxisAlignment: MainAxisAlignment.end, 106 | children: [ 107 | Transform( 108 | transform: Matrix4.translationValues( 109 | 0.0, 110 | _translateButton.value * 3, 111 | 0.0, 112 | ), 113 | child: _item(title: "One", example: Example.one), 114 | ), 115 | Transform( 116 | transform: Matrix4.translationValues( 117 | 0.0, 118 | _translateButton.value * 2, 119 | 0.0, 120 | ), 121 | child: _item(title: "Two", example: Example.two), 122 | ), 123 | Transform( 124 | transform: Matrix4.translationValues( 125 | 0.0, 126 | _translateButton.value * 1, 127 | 0.0, 128 | ), 129 | child: _item(title: "Three", example: Example.three), 130 | ), 131 | _toggle(), 132 | ], 133 | ), 134 | ) 135 | ], 136 | ); 137 | } 138 | 139 | Widget _switchWidget(Example example) { 140 | switch (example) { 141 | case Example.one: 142 | return ExampleOne(); 143 | break; 144 | case Example.two: 145 | return ExampleTwo(); 146 | break; 147 | case Example.three: 148 | return ExampleThree(); 149 | break; 150 | } 151 | } 152 | 153 | Widget _item({String title, Example example}) { 154 | //print(((_translateButton.value-66)/60).abs()); 155 | double val = ((_translateButton.value - 56) / 60).abs(); 156 | Color color; 157 | switch (example) { 158 | case Example.one: 159 | color = Colors.green[300]; 160 | break; 161 | case Example.two: 162 | color = Colors.orange[300]; 163 | break; 164 | default: 165 | color = Colors.blue[300]; 166 | } 167 | 168 | return Opacity( 169 | opacity: val > 0 ? 1 : 0, 170 | child: FloatingActionButton( 171 | backgroundColor: Colors.white, 172 | elevation: val, 173 | onPressed: () { 174 | setState(() => _currentExample = example); 175 | _animate(); 176 | }, 177 | tooltip: 'Apri', 178 | child: Text(title, 179 | style: TextStyle( 180 | fontSize: 11, 181 | color: color, 182 | )), 183 | ), 184 | ); 185 | } 186 | 187 | Widget _toggle() { 188 | return new Container( 189 | child: FloatingActionButton( 190 | elevation: 1.5, 191 | backgroundColor: Colors.white, 192 | onPressed: _animate, 193 | tooltip: 'Toggle', 194 | child: AnimatedIcon( 195 | icon: AnimatedIcons.menu_close, 196 | color: _buttonColor.value, 197 | progress: _animateIcon, 198 | ), 199 | ), 200 | ); 201 | } 202 | 203 | void _animate() { 204 | if (Navigator.of(context).canPop()) Navigator.of(context).pop(); 205 | if (!isOpened) 206 | _animationController.forward(); 207 | else 208 | _animationController.reverse(); 209 | isOpened = !isOpened; 210 | } 211 | } 212 | -------------------------------------------------------------------------------- /example/lib/notifier/drawer_notifier.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_inner_drawer/inner_drawer.dart'; 3 | 4 | class DrawerNotifier extends ChangeNotifier { 5 | double swipeOffset = 0; 6 | bool onTapToClose = false; 7 | bool swipe = true; 8 | bool tapScaffold = true; 9 | InnerDrawerAnimation animationType = InnerDrawerAnimation.static; 10 | double offset = 0.4; 11 | Color colorTransition = Colors.black54; 12 | 13 | InnerDrawerDirection direction = InnerDrawerDirection.start; 14 | 15 | void setSwipeOffset(double value) { 16 | swipeOffset = value; 17 | notifyListeners(); 18 | } 19 | 20 | void setSwipe(bool s) { 21 | swipe = s; 22 | notifyListeners(); 23 | } 24 | 25 | void setTapScaffold(bool t) { 26 | tapScaffold = t; 27 | notifyListeners(); 28 | } 29 | 30 | void setOnTapToClose(bool c) { 31 | onTapToClose = c; 32 | notifyListeners(); 33 | } 34 | 35 | void setAnimationType(InnerDrawerAnimation t) { 36 | animationType = t; 37 | notifyListeners(); 38 | } 39 | 40 | void setOffset(double o) { 41 | offset = o; 42 | notifyListeners(); 43 | } 44 | 45 | void setDirection(InnerDrawerDirection d) { 46 | direction = d; 47 | notifyListeners(); 48 | } 49 | 50 | void setColorTransition(Color c) { 51 | colorTransition = c; 52 | notifyListeners(); 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /example/lib/scaffolds/scaffolds_1.dart: -------------------------------------------------------------------------------- 1 | import 'package:example/notifier/drawer_notifier.dart'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:flutter_colorpicker/flutter_colorpicker.dart'; 4 | import 'package:flutter_inner_drawer/inner_drawer.dart'; 5 | import 'package:provider/provider.dart'; 6 | 7 | class ScaffoldDrawer extends StatelessWidget { 8 | Color pickerColor; 9 | final GlobalKey innerDrawerKey; 10 | 11 | ScaffoldDrawer({this.innerDrawerKey}); 12 | 13 | @override 14 | Widget build(BuildContext context) { 15 | print("scaffold 1"); 16 | 17 | final drawer = Provider.of(context, listen: true); 18 | pickerColor = drawer.colorTransition; 19 | 20 | return Container( 21 | decoration: BoxDecoration( 22 | gradient: LinearGradient( 23 | begin: Alignment.topRight, 24 | end: Alignment.bottomLeft, 25 | colors: [ 26 | ColorTween( 27 | begin: Colors.blueAccent, 28 | end: Colors.blueGrey[400].withRed(100), 29 | ).lerp(drawer.swipeOffset), 30 | ColorTween( 31 | begin: Colors.green, 32 | end: Colors.blueGrey[800].withGreen(80), 33 | ).lerp(drawer.swipeOffset), 34 | ], 35 | ), 36 | ), 37 | child: SafeArea( 38 | child: Material( 39 | color: Colors.transparent, 40 | child: DefaultTextStyle( 41 | style: TextStyle(color: Colors.grey[100]), 42 | child: Container( 43 | padding: EdgeInsets.symmetric(horizontal: 15), 44 | child: Column( 45 | crossAxisAlignment: CrossAxisAlignment.center, 46 | mainAxisAlignment: MainAxisAlignment.start, 47 | children: [ 48 | Padding( 49 | padding: EdgeInsets.all(10), 50 | ), 51 | Text( 52 | "Animation Type", 53 | style: TextStyle(fontWeight: FontWeight.w500), 54 | ), 55 | Row( 56 | mainAxisAlignment: MainAxisAlignment.center, 57 | children: [ 58 | GestureDetector( 59 | child: Row( 60 | children: [ 61 | Text('Static'), 62 | Checkbox( 63 | activeColor: Colors.black, 64 | value: drawer.animationType == 65 | InnerDrawerAnimation.static, 66 | onChanged: (a) { 67 | drawer.setAnimationType( 68 | InnerDrawerAnimation.static); 69 | }), 70 | ], 71 | ), 72 | onTap: () { 73 | drawer.setAnimationType(InnerDrawerAnimation.static); 74 | }, 75 | ), 76 | GestureDetector( 77 | child: Row( 78 | mainAxisAlignment: MainAxisAlignment.center, 79 | children: [ 80 | Checkbox( 81 | activeColor: Colors.black, 82 | value: drawer.animationType == 83 | InnerDrawerAnimation.linear, 84 | onChanged: (a) { 85 | drawer.setAnimationType( 86 | InnerDrawerAnimation.linear); 87 | }), 88 | Text('Linear'), 89 | ], 90 | ), 91 | onTap: () { 92 | drawer.setAnimationType(InnerDrawerAnimation.linear); 93 | }, 94 | ), 95 | GestureDetector( 96 | child: Row( 97 | mainAxisAlignment: MainAxisAlignment.center, 98 | children: [ 99 | Checkbox( 100 | activeColor: Colors.black, 101 | value: drawer.animationType == 102 | InnerDrawerAnimation.quadratic, 103 | onChanged: (a) { 104 | drawer.setAnimationType( 105 | InnerDrawerAnimation.quadratic); 106 | }), 107 | Text('Quadratic'), 108 | ], 109 | ), 110 | onTap: () { 111 | drawer 112 | .setAnimationType(InnerDrawerAnimation.quadratic); 113 | }, 114 | ), 115 | ], 116 | ), 117 | Padding( 118 | padding: EdgeInsets.all(10), 119 | ), 120 | Row( 121 | mainAxisAlignment: MainAxisAlignment.center, 122 | children: [ 123 | GestureDetector( 124 | child: Row( 125 | mainAxisAlignment: MainAxisAlignment.center, 126 | children: [ 127 | Checkbox( 128 | activeColor: Colors.black, 129 | value: drawer.swipe, 130 | onChanged: (a) { 131 | drawer.setSwipe(!drawer.swipe); 132 | }), 133 | Text('Swipe'), 134 | ], 135 | ), 136 | onTap: () { 137 | drawer.setSwipe(!drawer.swipe); 138 | }, 139 | ), 140 | GestureDetector( 141 | child: Row( 142 | mainAxisAlignment: MainAxisAlignment.center, 143 | children: [ 144 | Checkbox( 145 | activeColor: Colors.black, 146 | value: drawer.tapScaffold, 147 | onChanged: (a) { 148 | drawer.setTapScaffold(!drawer.tapScaffold); 149 | }), 150 | Text('TapScaffoldEnabled'), 151 | ], 152 | ), 153 | onTap: () { 154 | drawer.setTapScaffold(!drawer.tapScaffold); 155 | }, 156 | ), 157 | ], 158 | ), 159 | Padding( 160 | padding: EdgeInsets.all(10), 161 | ), 162 | GestureDetector( 163 | child: Row( 164 | mainAxisAlignment: MainAxisAlignment.center, 165 | children: [ 166 | Checkbox( 167 | activeColor: Colors.black, 168 | value: drawer.onTapToClose, 169 | onChanged: (a) { 170 | drawer.setOnTapToClose(!drawer.onTapToClose); 171 | }), 172 | Text('OnTap To Close'), 173 | ], 174 | ), 175 | onTap: () { 176 | drawer.setOnTapToClose(!drawer.onTapToClose); 177 | }, 178 | ), 179 | Padding( 180 | padding: EdgeInsets.all(10), 181 | ), 182 | Column( 183 | children: [ 184 | Text('Offset'), 185 | Row( 186 | mainAxisAlignment: MainAxisAlignment.center, 187 | children: [ 188 | SliderTheme( 189 | data: Theme.of(context).sliderTheme.copyWith( 190 | valueIndicatorTextStyle: Theme.of(context) 191 | .accentTextTheme 192 | .body2 193 | .copyWith(color: Colors.white), 194 | ), 195 | child: Slider( 196 | activeColor: Colors.black, 197 | //inactiveColor: Colors.white, 198 | value: drawer.offset, 199 | min: 0.0, 200 | max: 1, 201 | divisions: 5, 202 | semanticFormatterCallback: (double value) => 203 | value.round().toString(), 204 | label: '${drawer.offset}', 205 | onChanged: (a) { 206 | drawer.setOffset(a); 207 | }, 208 | onChangeEnd: (a) { 209 | //_getwidthContainer(); 210 | }, 211 | ), 212 | ), 213 | Text(drawer.offset.toString()), 214 | //Text(_fontSize.toString()), 215 | ], 216 | ), 217 | ], 218 | ), 219 | Padding(padding: EdgeInsets.all(10)), 220 | TextButton( 221 | child: Text( 222 | "Set Color Transition", 223 | style: TextStyle( 224 | color: drawer.colorTransition, 225 | fontWeight: FontWeight.w500), 226 | ), 227 | onPressed: () { 228 | showDialog( 229 | context: context, 230 | builder: (BuildContext context) { 231 | return AlertDialog( 232 | title: const Text('Pick a color!'), 233 | content: SingleChildScrollView( 234 | child: ColorPicker( 235 | pickerColor: drawer.colorTransition, 236 | onColorChanged: (Color color) => 237 | pickerColor = color, 238 | //enableLabel: true, 239 | pickerAreaHeightPercent: 0.8, 240 | ), 241 | ), 242 | actions: [ 243 | TextButton( 244 | child: Text('Set'), 245 | onPressed: () { 246 | drawer.setColorTransition(pickerColor); 247 | Navigator.of(context).pop(); 248 | }, 249 | ), 250 | ], 251 | ); 252 | }, 253 | ); 254 | }, 255 | ), 256 | Padding(padding: EdgeInsets.all(25)), 257 | ElevatedButton( 258 | child: Text("open"), 259 | onPressed: () { 260 | // direction is optional 261 | // if not set, the last direction will be used 262 | innerDrawerKey.currentState.toggle(); 263 | }, 264 | ), 265 | ], 266 | ), 267 | ), 268 | ), 269 | ))); 270 | } 271 | } 272 | -------------------------------------------------------------------------------- /example/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: example 2 | description: Example Inner Drawer. 3 | 4 | # The following defines the version and build number for your application. 5 | # A version number is three numbers separated by dots, like 1.2.43 6 | # followed by an optional build number separated by a +. 7 | # Both the version and the builder number may be overridden in flutter 8 | # build by specifying --build-name and --build-number, respectively. 9 | # Read more about versioning at semver.org. 10 | version: 1.0.0+1 11 | 12 | environment: 13 | sdk: ">=2.0.0-dev.68.0 <3.0.0" 14 | 15 | dependencies: 16 | flutter: 17 | sdk: flutter 18 | flutter_inner_drawer: 19 | path: ../ 20 | 21 | flutter_colorpicker: ^0.3.2 22 | provider: ^4.3.1 23 | 24 | # The following adds the Cupertino Icons font to your application. 25 | # Use with the CupertinoIcons class for iOS style icons. 26 | cupertino_icons: ^0.1.2 27 | 28 | dev_dependencies: 29 | flutter_test: 30 | sdk: flutter 31 | 32 | 33 | # For information on the generic Dart part of this file, see the 34 | # following page: https://www.dartlang.org/tools/pub/pubspec 35 | 36 | # The following section is specific to Flutter. 37 | flutter: 38 | 39 | # The following line ensures that the Material Icons font is 40 | # included with your application, so that you can use the icons in 41 | # the material Icons class. 42 | uses-material-design: true 43 | 44 | fonts: 45 | - family: icon 46 | fonts: 47 | - asset: fonts/ico/icomoon.ttf 48 | 49 | # To add assets to your application, add an assets section, like this: 50 | # assets: 51 | # - images/a_dot_burr.jpeg 52 | # - images/a_dot_ham.jpeg 53 | 54 | # An image asset can refer to one or more resolution-specific "variants", see 55 | # https://flutter.io/assets-and-images/#resolution-aware. 56 | 57 | # For details regarding adding assets from package dependencies, see 58 | # https://flutter.io/assets-and-images/#from-packages 59 | 60 | # To add custom fonts to your application, add a fonts section here, 61 | # in this "flutter" section. Each entry in this list should have a 62 | # "family" key with the font family name, and a "fonts" key with a 63 | # list giving the asset and other descriptors for the font. For 64 | # example: 65 | # fonts: 66 | # - family: Schyler 67 | # fonts: 68 | # - asset: fonts/Schyler-Regular.ttf 69 | # - asset: fonts/Schyler-Italic.ttf 70 | # style: italic 71 | # - family: Trajan Pro 72 | # fonts: 73 | # - asset: fonts/TrajanPro.ttf 74 | # - asset: fonts/TrajanPro_Bold.ttf 75 | # weight: 700 76 | # 77 | # For details regarding fonts from package dependencies, 78 | # see https://flutter.io/custom-fonts/#from-packages 79 | -------------------------------------------------------------------------------- /example/test/widget_test.dart: -------------------------------------------------------------------------------- 1 | // This is a basic Flutter widget test. 2 | // 3 | // To perform an interaction with a widget in your test, use the WidgetTester 4 | // utility that Flutter provides. For example, you can send tap and scroll 5 | // gestures. You can also use WidgetTester to find child widgets in the widget 6 | // tree, read text, and verify that the values of widget properties are correct. 7 | 8 | import 'package:flutter/material.dart'; 9 | import 'package:flutter_test/flutter_test.dart'; 10 | 11 | import 'package:example/main.dart'; 12 | 13 | void main() { 14 | testWidgets('Counter increments smoke test', (WidgetTester tester) async { 15 | // Build our app and trigger a frame. 16 | await tester.pumpWidget(MyApp()); 17 | 18 | // Verify that our counter starts at 0. 19 | expect(find.text('0'), findsOneWidget); 20 | expect(find.text('1'), findsNothing); 21 | 22 | // Tap the '+' icon and trigger a frame. 23 | await tester.tap(find.byIcon(Icons.add)); 24 | await tester.pump(); 25 | 26 | // Verify that our counter has incremented. 27 | expect(find.text('0'), findsNothing); 28 | expect(find.text('1'), findsOneWidget); 29 | }); 30 | } 31 | -------------------------------------------------------------------------------- /flutter_inner_drawer.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /lib/inner_drawer.dart: -------------------------------------------------------------------------------- 1 | // InnerDrawer is based on Drawer. 2 | // The source code of the Drawer has been re-adapted for Inner Drawer. 3 | 4 | // more details: 5 | // https://github.com/flutter/flutter/blob/master/packages/flutter/lib/src/material/drawer.dart 6 | 7 | import 'dart:math'; 8 | import 'package:flutter/material.dart'; 9 | import 'package:flutter/foundation.dart'; 10 | import 'package:flutter/widgets.dart'; 11 | 12 | /// Signature for the callback that's called when a [InnerDrawer] is 13 | /// opened or closed. 14 | typedef InnerDrawerCallback = void Function(bool isOpened); 15 | 16 | /// Signature for when a pointer that is in contact with the screen and moves to the right or left 17 | /// values between 1 and 0 18 | typedef InnerDragUpdateCallback = void Function( 19 | double value, InnerDrawerDirection? direction); 20 | 21 | /// The possible position of a [InnerDrawer]. 22 | enum InnerDrawerDirection { 23 | start, 24 | end, 25 | } 26 | 27 | /// Animation type of a [InnerDrawer]. 28 | enum InnerDrawerAnimation { 29 | static, 30 | linear, 31 | quadratic, 32 | } 33 | 34 | //width before initState 35 | const double _kWidth = 400; 36 | const double _kMinFlingVelocity = 365.0; 37 | const double _kEdgeDragWidth = 20.0; 38 | const Duration _kBaseSettleDuration = Duration(milliseconds: 246); 39 | 40 | class InnerDrawer extends StatefulWidget { 41 | const InnerDrawer( 42 | {GlobalKey? key, 43 | this.leftChild, 44 | this.rightChild, 45 | required this.scaffold, 46 | this.offset = const IDOffset.horizontal(0.4), 47 | this.scale = const IDOffset.horizontal(1), 48 | this.proportionalChildArea = true, 49 | this.borderRadius = 0, 50 | this.onTapClose = false, 51 | this.tapScaffoldEnabled = false, 52 | this.swipe = true, 53 | this.swipeChild = false, 54 | this.duration, 55 | this.velocity = 1, 56 | this.boxShadow, 57 | this.colorTransitionChild, 58 | this.colorTransitionScaffold, 59 | this.leftAnimationType = InnerDrawerAnimation.static, 60 | this.rightAnimationType = InnerDrawerAnimation.static, 61 | this.backgroundDecoration, 62 | this.innerDrawerCallback, 63 | this.onDragUpdate}) 64 | : assert(leftChild != null || rightChild != null), 65 | assert(scaffold != null), 66 | super(key: key); 67 | 68 | /// Left child 69 | final Widget? leftChild; 70 | 71 | /// Right child 72 | final Widget? rightChild; 73 | 74 | /// A Scaffold is generally used but you are free to use other widgets 75 | final Widget scaffold; 76 | 77 | /// When the [InnerDrawer] is open, it's possible to set the offset of each of the four cardinal directions 78 | final IDOffset offset; 79 | 80 | /// When the [InnerDrawer] is open to the left or to the right 81 | /// values between 1 and 0. (default 1) 82 | final IDOffset scale; 83 | 84 | /// The proportionalChild Area = true dynamically sets the width based on the selected offset. 85 | /// On false it leaves the width at 100% of the screen 86 | final bool proportionalChildArea; 87 | 88 | /// edge radius when opening the scaffold - (defalut 0) 89 | final double borderRadius; 90 | 91 | /// Closes the open scaffold 92 | final bool tapScaffoldEnabled; 93 | 94 | /// Closes the open scaffold 95 | final bool onTapClose; 96 | 97 | /// activate or deactivate the swipe. NOTE: when deactivate, onTap Close is implicitly activated 98 | final bool swipe; 99 | 100 | /// activate or deactivate the swipeChild. NOTE: when deactivate, onTap Close is implicitly activated 101 | final bool swipeChild; 102 | 103 | /// duration animation controller 104 | final Duration? duration; 105 | 106 | /// possibility to set the opening and closing velocity 107 | final double velocity; 108 | 109 | /// BoxShadow of scaffold open 110 | final List? boxShadow; 111 | 112 | ///Color of gradient background 113 | final Color? colorTransitionChild; 114 | 115 | ///Color of gradient background 116 | final Color? colorTransitionScaffold; 117 | 118 | /// Static or Linear or Quadratic 119 | final InnerDrawerAnimation leftAnimationType; 120 | 121 | /// Static or Linear or Quadratic 122 | final InnerDrawerAnimation rightAnimationType; 123 | 124 | /// Color of the main background 125 | final Decoration? backgroundDecoration; 126 | 127 | /// Optional callback that is called when a [InnerDrawer] is open or closed. 128 | final InnerDrawerCallback? innerDrawerCallback; 129 | 130 | /// when a pointer that is in contact with the screen and moves to the right or left 131 | final InnerDragUpdateCallback? onDragUpdate; 132 | 133 | @override 134 | InnerDrawerState createState() => InnerDrawerState(); 135 | } 136 | 137 | class InnerDrawerState extends State 138 | with SingleTickerProviderStateMixin { 139 | ColorTween _colorTransitionChild = 140 | ColorTween(begin: Colors.transparent, end: Colors.black54); 141 | ColorTween _colorTransitionScaffold = 142 | ColorTween(begin: Colors.black54, end: Colors.transparent); 143 | 144 | double _initWidth = _kWidth; 145 | Orientation _orientation = Orientation.portrait; 146 | InnerDrawerDirection? _position; 147 | 148 | @override 149 | void initState() { 150 | _position = _leftChild != null 151 | ? InnerDrawerDirection.start 152 | : InnerDrawerDirection.end; 153 | 154 | _controller = AnimationController( 155 | value: 1, 156 | duration: widget.duration ?? _kBaseSettleDuration, 157 | vsync: this) 158 | ..addListener(_animationChanged) 159 | ..addStatusListener(_animationStatusChanged); 160 | super.initState(); 161 | } 162 | 163 | @override 164 | void dispose() { 165 | _historyEntry?.remove(); 166 | _controller.dispose(); 167 | _focusScopeNode.dispose(); 168 | super.dispose(); 169 | } 170 | 171 | void _animationChanged() { 172 | setState(() { 173 | // The animation controller's state is our build state, and it changed already. 174 | }); 175 | if (widget.colorTransitionChild != null) 176 | _colorTransitionChild = ColorTween( 177 | begin: widget.colorTransitionChild!.withOpacity(0.0), 178 | end: widget.colorTransitionChild); 179 | 180 | if (widget.colorTransitionScaffold != null) 181 | _colorTransitionScaffold = ColorTween( 182 | begin: widget.colorTransitionScaffold, 183 | end: widget.colorTransitionScaffold!.withOpacity(0.0)); 184 | 185 | if (widget.onDragUpdate != null && _controller.value < 1) { 186 | widget.onDragUpdate!((1 - _controller.value), _position); 187 | } 188 | } 189 | 190 | LocalHistoryEntry? _historyEntry; 191 | final FocusScopeNode _focusScopeNode = FocusScopeNode(); 192 | 193 | void _ensureHistoryEntry() { 194 | if (_historyEntry == null) { 195 | final ModalRoute? route = ModalRoute.of(context); 196 | if (route != null) { 197 | _historyEntry = LocalHistoryEntry(onRemove: _handleHistoryEntryRemoved); 198 | route.addLocalHistoryEntry(_historyEntry!); 199 | FocusScope.of(context).setFirstFocus(_focusScopeNode); 200 | } 201 | } 202 | } 203 | 204 | void _animationStatusChanged(AnimationStatus status) { 205 | final bool opened = _controller.value < 0.5 ? true : false; 206 | 207 | switch (status) { 208 | case AnimationStatus.reverse: 209 | break; 210 | case AnimationStatus.forward: 211 | break; 212 | case AnimationStatus.dismissed: 213 | if (_previouslyOpened != opened) { 214 | _previouslyOpened = opened; 215 | if (widget.innerDrawerCallback != null) 216 | widget.innerDrawerCallback!(opened); 217 | } 218 | _ensureHistoryEntry(); 219 | break; 220 | case AnimationStatus.completed: 221 | if (_previouslyOpened != opened) { 222 | _previouslyOpened = opened; 223 | if (widget.innerDrawerCallback != null) 224 | widget.innerDrawerCallback!(opened); 225 | } 226 | _historyEntry?.remove(); 227 | _historyEntry = null; 228 | } 229 | } 230 | 231 | void _handleHistoryEntryRemoved() { 232 | _historyEntry = null; 233 | close(); 234 | } 235 | 236 | late AnimationController _controller; 237 | 238 | void _handleDragDown(DragDownDetails details) { 239 | _controller.stop(); 240 | //_ensureHistoryEntry(); 241 | } 242 | 243 | final GlobalKey _drawerKey = GlobalKey(); 244 | 245 | double get _width { 246 | return _initWidth; 247 | } 248 | 249 | double get _velocity { 250 | return widget.velocity; 251 | } 252 | 253 | /// get width of screen after initState 254 | void _updateWidth() { 255 | WidgetsBinding.instance!.addPostFrameCallback((_) { 256 | final RenderBox? box = 257 | _drawerKey.currentContext!.findRenderObject() as RenderBox?; 258 | //final RenderBox box = context.findRenderObject(); 259 | if (box != null && 260 | box.hasSize && 261 | box.size != null && 262 | box.size.width > 300) 263 | setState(() { 264 | _initWidth = box.size.width; 265 | }); 266 | }); 267 | } 268 | 269 | bool _previouslyOpened = false; 270 | 271 | void _move(DragUpdateDetails details) { 272 | double delta = details.primaryDelta! / _width; 273 | 274 | if (delta > 0 && _controller.value == 1 && _leftChild != null) 275 | _position = InnerDrawerDirection.start; 276 | else if (delta < 0 && _controller.value == 1 && _rightChild != null) 277 | _position = InnerDrawerDirection.end; 278 | 279 | double offset = _position == InnerDrawerDirection.start 280 | ? widget.offset.left 281 | : widget.offset.right; 282 | 283 | double ee = 1; 284 | if (offset <= 0.2) 285 | ee = 1.7; 286 | else if (offset <= 0.4) 287 | ee = 1.2; 288 | else if (offset <= 0.6) ee = 1.05; 289 | 290 | offset = 1 - 291 | (pow(offset / ee, 1 / 2) 292 | as double); //(num.parse(pow(offset/2,1/3).toStringAsFixed(1))); 293 | 294 | switch (_position) { 295 | case InnerDrawerDirection.end: 296 | break; 297 | case InnerDrawerDirection.start: 298 | delta = -delta; 299 | break; 300 | } 301 | switch (Directionality.of(context)) { 302 | case TextDirection.rtl: 303 | _controller.value -= delta + (delta * offset); 304 | break; 305 | case TextDirection.ltr: 306 | _controller.value += delta + (delta * offset); 307 | break; 308 | } 309 | 310 | final bool opened = _controller.value < 0.5 ? true : false; 311 | if (opened != _previouslyOpened && widget.innerDrawerCallback != null) 312 | widget.innerDrawerCallback!(opened); 313 | _previouslyOpened = opened; 314 | } 315 | 316 | void _settle(DragEndDetails details) { 317 | if (_controller.isDismissed) return; 318 | if (details.velocity.pixelsPerSecond.dx.abs() >= _kMinFlingVelocity) { 319 | double visualVelocity = 320 | (details.velocity.pixelsPerSecond.dx + _velocity) / _width; 321 | 322 | switch (_position) { 323 | case InnerDrawerDirection.end: 324 | break; 325 | case InnerDrawerDirection.start: 326 | visualVelocity = -visualVelocity; 327 | break; 328 | } 329 | switch (Directionality.of(context)) { 330 | case TextDirection.rtl: 331 | _controller.fling(velocity: -visualVelocity); 332 | break; 333 | case TextDirection.ltr: 334 | _controller.fling(velocity: visualVelocity); 335 | break; 336 | } 337 | } else if (_controller.value < 0.5) { 338 | open(); 339 | } else { 340 | close(); 341 | } 342 | } 343 | 344 | void open({InnerDrawerDirection? direction}) { 345 | if (direction != null) _position = direction; 346 | _controller.fling(velocity: -_velocity); 347 | } 348 | 349 | void close({InnerDrawerDirection? direction}) { 350 | if (direction != null) _position = direction; 351 | _controller.fling(velocity: _velocity); 352 | } 353 | 354 | /// Open or Close InnerDrawer 355 | void toggle({InnerDrawerDirection? direction}) { 356 | if (_previouslyOpened) 357 | close(direction: direction); 358 | else 359 | open(direction: direction); 360 | } 361 | 362 | final GlobalKey _gestureDetectorKey = GlobalKey(); 363 | 364 | /// Outer Alignment 365 | AlignmentDirectional? get _drawerOuterAlignment { 366 | switch (_position) { 367 | case InnerDrawerDirection.start: 368 | return AlignmentDirectional.centerEnd; 369 | case InnerDrawerDirection.end: 370 | return AlignmentDirectional.centerStart; 371 | } 372 | return null; 373 | } 374 | 375 | /// Inner Alignment 376 | AlignmentDirectional? get _drawerInnerAlignment { 377 | switch (_position) { 378 | case InnerDrawerDirection.start: 379 | return AlignmentDirectional.centerStart; 380 | case InnerDrawerDirection.end: 381 | return AlignmentDirectional.centerEnd; 382 | } 383 | return null; 384 | } 385 | 386 | /// returns the left or right animation type based on InnerDrawerDirection 387 | InnerDrawerAnimation get _animationType { 388 | return _position == InnerDrawerDirection.start 389 | ? widget.leftAnimationType 390 | : widget.rightAnimationType; 391 | } 392 | 393 | /// returns the left or right scale based on InnerDrawerDirection 394 | double get _scaleFactor { 395 | return _position == InnerDrawerDirection.start 396 | ? widget.scale.left 397 | : widget.scale.right; 398 | } 399 | 400 | /// returns the left or right offset based on InnerDrawerDirection 401 | double get _offset { 402 | return _position == InnerDrawerDirection.start 403 | ? widget.offset.left 404 | : widget.offset.right; 405 | } 406 | 407 | /// return width with specific offset 408 | double get _widthWithOffset { 409 | return (_width / 2) - (_width / 2) * _offset; 410 | //NEW 411 | //return _width - _width * _offset; 412 | } 413 | 414 | /// return swipe 415 | bool get _swipe { 416 | //NEW 417 | //if( _offset == 0 ) return false; 418 | return widget.swipe; 419 | } 420 | 421 | /// return swipeChild 422 | bool get _swipeChild { 423 | //NEW 424 | //if( _offset == 0 ) return false; 425 | return widget.swipeChild; 426 | } 427 | 428 | /// Scaffold 429 | Widget _scaffold() { 430 | assert(widget.borderRadius >= 0); 431 | 432 | final Widget? invC = _invisibleCover(); 433 | 434 | final Widget scaffoldChild = Stack( 435 | children: [widget.scaffold, invC != null ? invC : null] 436 | .where((a) => a != null) 437 | .toList() as List, 438 | ); 439 | 440 | Widget container = Container( 441 | key: _drawerKey, 442 | decoration: BoxDecoration( 443 | borderRadius: BorderRadius.circular( 444 | widget.borderRadius * (1 - _controller.value)), 445 | boxShadow: widget.boxShadow ?? 446 | [ 447 | BoxShadow( 448 | color: Colors.black.withOpacity(0.5), 449 | blurRadius: 5, 450 | ) 451 | ]), 452 | child: widget.borderRadius != 0 453 | ? ClipRRect( 454 | borderRadius: BorderRadius.circular( 455 | (1 - _controller.value) * widget.borderRadius), 456 | child: scaffoldChild) 457 | : scaffoldChild); 458 | 459 | if (_scaleFactor < 1) 460 | container = Transform.scale( 461 | alignment: _drawerInnerAlignment, 462 | scale: ((1 - _scaleFactor) * _controller.value) + _scaleFactor, 463 | child: container, 464 | ); 465 | 466 | // Vertical translate 467 | if (widget.offset != null && 468 | (widget.offset.top > 0 || widget.offset.bottom > 0)) { 469 | final double translateY = MediaQuery.of(context).size.height * 470 | (widget.offset.top > 0 ? -widget.offset.top : widget.offset.bottom); 471 | container = Transform.translate( 472 | offset: Offset(0, translateY * (1 - _controller.value)), 473 | child: container, 474 | ); 475 | } 476 | 477 | return container; 478 | } 479 | 480 | ///Disable the scaffolding tap when the drawer is open 481 | Widget? _invisibleCover() { 482 | final Container container = Container( 483 | color: _colorTransitionScaffold.evaluate(_controller), 484 | ); 485 | if (_controller.value != 1.0 && !widget.tapScaffoldEnabled) 486 | return BlockSemantics( 487 | child: GestureDetector( 488 | // On Android, the back button is used to dismiss a modal. 489 | excludeFromSemantics: defaultTargetPlatform == TargetPlatform.android, 490 | onTap: widget.onTapClose || !_swipe ? close : null, 491 | child: Semantics( 492 | label: MaterialLocalizations.of(context).modalBarrierDismissLabel, 493 | child: container, 494 | ), 495 | ), 496 | ); 497 | return null; 498 | } 499 | 500 | Widget? get _leftChild { 501 | return widget.leftChild; 502 | } 503 | 504 | Widget? get _rightChild { 505 | return widget.rightChild; 506 | } 507 | 508 | /// return widget with specific animation 509 | Widget _animatedChild() { 510 | Widget? child = 511 | _position == InnerDrawerDirection.start ? _leftChild : _rightChild; 512 | if (_swipeChild) { 513 | child = GestureDetector( 514 | onHorizontalDragUpdate: _move, 515 | onHorizontalDragEnd: _settle, 516 | child: child, 517 | ); 518 | } 519 | final Widget container = Container( 520 | width: widget.proportionalChildArea ? _width - _widthWithOffset : _width, 521 | height: MediaQuery.of(context).size.height, 522 | child: child, 523 | ); 524 | 525 | switch (_animationType) { 526 | case InnerDrawerAnimation.linear: 527 | return Align( 528 | alignment: _drawerOuterAlignment!, 529 | widthFactor: 1 - (_controller.value), 530 | child: container, 531 | ); 532 | case InnerDrawerAnimation.quadratic: 533 | return Align( 534 | alignment: _drawerOuterAlignment!, 535 | widthFactor: 1 - (_controller.value / 2), 536 | child: container, 537 | ); 538 | default: 539 | return container; 540 | } 541 | } 542 | 543 | /// Trigger Area 544 | Widget? _trigger(AlignmentDirectional alignment, Widget? child) { 545 | assert(alignment != null); 546 | final bool drawerIsStart = _position == InnerDrawerDirection.start; 547 | final EdgeInsets padding = MediaQuery.of(context).padding; 548 | double dragAreaWidth = drawerIsStart ? padding.left : padding.right; 549 | 550 | if (Directionality.of(context) == TextDirection.rtl) 551 | dragAreaWidth = drawerIsStart ? padding.right : padding.left; 552 | dragAreaWidth = max(dragAreaWidth, _kEdgeDragWidth); 553 | 554 | if (_controller.status == AnimationStatus.completed && 555 | _swipe && 556 | child != null) 557 | return Align( 558 | alignment: alignment, 559 | child: Container(color: Colors.transparent, width: dragAreaWidth), 560 | ); 561 | else 562 | return null; 563 | } 564 | 565 | @override 566 | Widget build(BuildContext context) { 567 | //assert(debugCheckHasMaterialLocalizations(context)); 568 | 569 | /// initialize the correct width 570 | if (_initWidth == 400 || 571 | MediaQuery.of(context).orientation != _orientation) { 572 | _updateWidth(); 573 | _orientation = MediaQuery.of(context).orientation; 574 | } 575 | 576 | /// wFactor depends of offset and is used by the second Align that contains the Scaffold 577 | final double offset = 0.5 - _offset * 0.5; 578 | //NEW 579 | //final double offset = 1 - _offset * 1; 580 | final double wFactor = (_controller.value * (1 - offset)) + offset; 581 | 582 | return Container( 583 | decoration: widget.backgroundDecoration ?? 584 | BoxDecoration( 585 | color: Theme.of(context).backgroundColor, 586 | ), 587 | child: Stack( 588 | alignment: _drawerInnerAlignment!, 589 | children: [ 590 | FocusScope(node: _focusScopeNode, child: _animatedChild()), 591 | GestureDetector( 592 | key: _gestureDetectorKey, 593 | onTap: () {}, 594 | onHorizontalDragDown: _swipe ? _handleDragDown : null, 595 | onHorizontalDragUpdate: _swipe ? _move : null, 596 | onHorizontalDragEnd: _swipe ? _settle : null, 597 | excludeFromSemantics: true, 598 | child: RepaintBoundary( 599 | child: Stack( 600 | children: [ 601 | ///Gradient 602 | Container( 603 | width: _controller.value == 0 || 604 | _animationType == InnerDrawerAnimation.linear 605 | ? 0 606 | : null, 607 | color: _colorTransitionChild.evaluate(_controller), 608 | ), 609 | Align( 610 | alignment: _drawerOuterAlignment!, 611 | child: Align( 612 | alignment: _drawerInnerAlignment!, 613 | widthFactor: wFactor, 614 | child: RepaintBoundary(child: _scaffold())), 615 | ), 616 | 617 | ///Trigger 618 | _trigger(AlignmentDirectional.centerStart, _leftChild), 619 | _trigger(AlignmentDirectional.centerEnd, _rightChild), 620 | ].where((a) => a != null).toList() as List, 621 | ), 622 | ), 623 | ), 624 | ], 625 | ), 626 | ); 627 | } 628 | } 629 | 630 | ///An immutable set of offset in each of the four cardinal directions. 631 | class IDOffset { 632 | const IDOffset.horizontal( 633 | double horizontal, 634 | ) : left = horizontal, 635 | top = 0.0, 636 | right = horizontal, 637 | bottom = 0.0; 638 | 639 | const IDOffset.only({ 640 | this.left = 0.0, 641 | this.top = 0.0, 642 | this.right = 0.0, 643 | this.bottom = 0.0, 644 | }) : assert(top >= 0.0 && 645 | top <= 1.0 && 646 | left >= 0.0 && 647 | left <= 1.0 && 648 | right >= 0.0 && 649 | right <= 1.0 && 650 | bottom >= 0.0 && 651 | bottom <= 1.0), 652 | assert(top >= 0.0 && bottom == 0.0 || top == 0.0 && bottom >= 0.0); 653 | 654 | /// The offset from the left. 655 | final double left; 656 | 657 | /// The offset from the top. 658 | final double top; 659 | 660 | /// The offset from the right. 661 | final double right; 662 | 663 | /// The offset from the bottom. 664 | final double bottom; 665 | } 666 | -------------------------------------------------------------------------------- /pubspec.lock: -------------------------------------------------------------------------------- 1 | # Generated by pub 2 | # See https://dart.dev/tools/pub/glossary#lockfile 3 | packages: 4 | async: 5 | dependency: transitive 6 | description: 7 | name: async 8 | url: "https://pub.dartlang.org" 9 | source: hosted 10 | version: "2.5.0" 11 | boolean_selector: 12 | dependency: transitive 13 | description: 14 | name: boolean_selector 15 | url: "https://pub.dartlang.org" 16 | source: hosted 17 | version: "2.1.0" 18 | characters: 19 | dependency: transitive 20 | description: 21 | name: characters 22 | url: "https://pub.dartlang.org" 23 | source: hosted 24 | version: "1.1.0" 25 | charcode: 26 | dependency: transitive 27 | description: 28 | name: charcode 29 | url: "https://pub.dartlang.org" 30 | source: hosted 31 | version: "1.2.0" 32 | clock: 33 | dependency: transitive 34 | description: 35 | name: clock 36 | url: "https://pub.dartlang.org" 37 | source: hosted 38 | version: "1.1.0" 39 | collection: 40 | dependency: transitive 41 | description: 42 | name: collection 43 | url: "https://pub.dartlang.org" 44 | source: hosted 45 | version: "1.15.0" 46 | fake_async: 47 | dependency: transitive 48 | description: 49 | name: fake_async 50 | url: "https://pub.dartlang.org" 51 | source: hosted 52 | version: "1.2.0" 53 | flutter: 54 | dependency: "direct main" 55 | description: flutter 56 | source: sdk 57 | version: "0.0.0" 58 | flutter_test: 59 | dependency: "direct dev" 60 | description: flutter 61 | source: sdk 62 | version: "0.0.0" 63 | matcher: 64 | dependency: transitive 65 | description: 66 | name: matcher 67 | url: "https://pub.dartlang.org" 68 | source: hosted 69 | version: "0.12.10" 70 | meta: 71 | dependency: transitive 72 | description: 73 | name: meta 74 | url: "https://pub.dartlang.org" 75 | source: hosted 76 | version: "1.3.0" 77 | path: 78 | dependency: transitive 79 | description: 80 | name: path 81 | url: "https://pub.dartlang.org" 82 | source: hosted 83 | version: "1.8.0" 84 | sky_engine: 85 | dependency: transitive 86 | description: flutter 87 | source: sdk 88 | version: "0.0.99" 89 | source_span: 90 | dependency: transitive 91 | description: 92 | name: source_span 93 | url: "https://pub.dartlang.org" 94 | source: hosted 95 | version: "1.8.0" 96 | stack_trace: 97 | dependency: transitive 98 | description: 99 | name: stack_trace 100 | url: "https://pub.dartlang.org" 101 | source: hosted 102 | version: "1.10.0" 103 | stream_channel: 104 | dependency: transitive 105 | description: 106 | name: stream_channel 107 | url: "https://pub.dartlang.org" 108 | source: hosted 109 | version: "2.1.0" 110 | string_scanner: 111 | dependency: transitive 112 | description: 113 | name: string_scanner 114 | url: "https://pub.dartlang.org" 115 | source: hosted 116 | version: "1.1.0" 117 | term_glyph: 118 | dependency: transitive 119 | description: 120 | name: term_glyph 121 | url: "https://pub.dartlang.org" 122 | source: hosted 123 | version: "1.2.0" 124 | test_api: 125 | dependency: transitive 126 | description: 127 | name: test_api 128 | url: "https://pub.dartlang.org" 129 | source: hosted 130 | version: "0.2.19" 131 | typed_data: 132 | dependency: transitive 133 | description: 134 | name: typed_data 135 | url: "https://pub.dartlang.org" 136 | source: hosted 137 | version: "1.3.0" 138 | vector_math: 139 | dependency: transitive 140 | description: 141 | name: vector_math 142 | url: "https://pub.dartlang.org" 143 | source: hosted 144 | version: "2.1.0" 145 | sdks: 146 | dart: ">=2.12.0 <3.0.0" 147 | -------------------------------------------------------------------------------- /pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: flutter_inner_drawer 2 | description: Inner Drawer is an easy way to create an internal side section (left/right) where you can insert a list menu or other. 3 | version: 1.0.0+1 4 | author: Antonino Di Natale 5 | homepage: https://github.com/Dn-a/flutter_inner_drawer 6 | 7 | environment: 8 | sdk: '>=2.12.0 <3.0.0' 9 | 10 | dependencies: 11 | flutter: 12 | sdk: flutter 13 | 14 | dev_dependencies: 15 | flutter_test: 16 | sdk: flutter 17 | -------------------------------------------------------------------------------- /test/flutter_inner_drawer_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter_test/flutter_test.dart'; 2 | 3 | void main() {} 4 | --------------------------------------------------------------------------------