11# flutter_inner_drawer
2- [ ![ pub package] ( https://img.shields.io/badge/pub-0.3 .0-orange.svg )] ( https://pub.dartlang.org/packages/flutter_inner_drawer )
2+ [ ![ pub package] ( https://img.shields.io/badge/pub-0.4 .0-orange.svg )] ( https://pub.dartlang.org/packages/flutter_inner_drawer )
33[ ![ Awesome Flutter] ( https://img.shields.io/badge/Awesome-Flutter-blue.svg?longCache=true&style=flat-square )] ( https://github.com/Solido/awesome-flutter#drawers )
44[ ![ Donate] ( https://img.shields.io/badge/Donate-PayPal-green.svg )] ( https://www.paypal.me/dnag88 )
55
@@ -10,16 +10,13 @@ Inner Drawer is an easy way to create an internal side section (left/right) wher
1010Add this to your package's pubspec.yaml file:
1111``` dart
1212dependencies:
13- flutter_inner_drawer: "^0.3 .0"
13+ flutter_inner_drawer: "^0.4 .0"
1414```
1515## Demo
1616<div align =" center " >
1717 <table ><tr >
18- <td style =" text-align :center " >
19- <img width =" 250px " src =" https://github.com/Dn-a/flutter_inner_drawer/blob/master/example/example3.gif?raw=true " />
20- </td >
21- <td style =" text-align :center " >
22- <img width =" 250px " src =" https://github.com/Dn-a/flutter_inner_drawer/blob/master/example/pic.png?raw=true " />
18+ <td style =" text-align :center " >
19+ <img width =" 250px " src =" https://github.com/Dn-a/flutter_inner_drawer/blob/master/example/example4.gif?raw=true " />
2320 </td >
2421 </tr ></table >
2522</div >
@@ -40,61 +37,64 @@ import 'package:flutter_inner_drawer/inner_drawer.dart';
4037 {
4138 return InnerDrawer(
4239 key: _innerDrawerKey,
43- position: InnerDrawerPosition.start, // required
4440 onTapClose: true, // default false
45- swipe: true, // default true
46- offset: 0.6, // default 0.4
41+ swipe: true, // default true
4742 colorTransition: Color.red, // default Color.black54
48- animationType: InnerDrawerAnimation.linear, // default static
49- innerDrawerCallback: (a) => print(a), // return bool
50- child: Material(
51- child: SafeArea(
52- child: Container(...)
53- )
54- ),
43+ innerDrawerCallback: (a) => print(a ),// return bool
44+ leftOffset: 0.6, // default 0.4
45+ rightOffset: 0.6, // default 0.4
46+ leftAnimationType: InnerDrawerAnimation.static, // default static
47+ rightAnimationType: InnerDrawerAnimation.quadratic, // default static
48+ // at least one child is required
49+ leftChild: Container(),
50+ rightChild: Container(),
5551 // A Scaffold is generally used but you are free to use other widgets
5652 // Note: use "automaticallyImplyLeading: false" if you do not personalize "leading" of Bar
5753 scaffold: Scaffold(
5854 appBar: AppBar(
5955 automaticallyImplyLeading: false
60- )
61- .
62- .
56+ ),
6357 )
64- or
58+ OR
6559 CupertinoPageScaffold(
6660 navigationBar: CupertinoNavigationBar(
6761 automaticallyImplyLeading: false
6862 ),
69- .
70- .
7163 ),
7264 )
7365 }
7466
75- void _open ()
67+ void _toggle ()
7668 {
77- _innerDrawerKey.currentState.open();
69+ _innerDrawerKey.currentState.toggle(
70+ // direction is optional
71+ // if not set, the last direction will be used
72+ direction: InnerDrawerDirection.end
73+ );
7874 }
7975
80- void _close()
81- {
82- _innerDrawerKey.currentState.close();
83- }
76+
8477
8578```
8679
8780### All parameters
88- * child - * Inner Widget (required)*
89- * scaffold - * A Scaffold is generally used but you are free to use other widgets (required)*
90- * position - * This controls the direction in which the user should swipe to open and close the InnerDrawer (required)*
91- * offset - * Offset drawer width (default 0.4)*
92- * onTapClose - * bool (default false)*
93- * swipe - * bool (default true)*
94- * boxShadow - * BoxShadow of scaffold opened*
95- * colorTransition - * default Colors.black54*
96- * animationType - * static / linear / quadratic (default static)*
97- * innerDrawerCallback - * Optional callback that is called when a InnerDrawer is opened or closed*
81+ * ` leftChild ` - * Inner Widget*
82+ * ` rightChild ` - * Inner Widget*
83+ * ` scaffold ` - * A Scaffold is generally used but you are free to use other widgets (required)*
84+ * ` leftOffset ` - * Offset drawer width (default 0.4)*
85+ * ` rightOffset ` - * Offset drawer width (default 0.4)*
86+ * ` onTapClose ` - * bool (default false)*
87+ * ` swipe ` - * bool (default true)*
88+ * ` tapScaffoldEnabled ` - * possibility to tap the scaffold even when open (default false)*
89+ * ` boxShadow ` - * BoxShadow of scaffold opened*
90+ * ` colorTransition ` - * default Colors.black54*
91+ * ` leftAnimationType ` - * static / linear / quadratic (default static)*
92+ * ` rightAnimationType ` - * static / linear / quadratic (default static)*
93+ * ` innerDrawerCallback ` - * Optional callback that is called when a InnerDrawer is opened or closed*
94+ * ` innerDrawerKey.currentState.open ` - * Open InnerDrawer*
95+ * ` innerDrawerKey.currentState.close ` - * Close InnerDrawer*
96+ * ` innerDrawerKey.currentState.toggle ` - * Open or Close InnerDrawer*
97+
9898
9999## Donate
100100If you found this project helpful or you learned something from the source code and want to thank me:
0 commit comments