Skip to content

Commit edff272

Browse files
committed
New Features and Documentation Updates
1 parent 0002171 commit edff272

File tree

8 files changed

+622
-617
lines changed

8 files changed

+622
-617
lines changed

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
## [0.4.0] - 2019-08-07.
2+
3+
* **new Features and Documentation Updates**
4+
*
5+
* Parameter `position` removed. Now it is possible to define `leftChild` and `rightChild` simultaneously.
6+
* Parameter `offset` replaced with `leftOffset` and `rightOffset`.
7+
* Parameter `animationType` replaced with `leftAnimationType` and `rightAnimationType`.
8+
* Possibility to tap the scaffold even when open with `tapScaffoldEnabled`.
9+
110
## [0.3.0] - 2019-07-07.
211

312
* General improvement of the code.

README.md

Lines changed: 39 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
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
1010
Add this to your package's pubspec.yaml file:
1111
```dart
1212
dependencies:
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
100100
If you found this project helpful or you learned something from the source code and want to thank me:

0 commit comments

Comments
 (0)