Skip to content

Commit a41c751

Browse files
committed
Added toggle method - updated dependencies
1 parent 3b8e379 commit a41c751

File tree

6 files changed

+21
-8
lines changed

6 files changed

+21
-8
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
## [0.2.9] - 2019-06-20.
2+
3+
* Updated dependencies.
4+
* Added toggle method.
5+
16
## [0.2.8] - 2019-06-14.
27

38
* fix history.

README.md

Lines changed: 2 additions & 2 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.2.8-orange.svg)](https://pub.dartlang.org/packages/flutter_inner_drawer)
2+
[![pub package](https://img.shields.io/badge/pub-0.2.9-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,7 +10,7 @@ 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.2.8"
13+
flutter_inner_drawer: "^0.2.9"
1414
```
1515
## Demo
1616
<div align="center">

example/lib/main.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ class _MyHomePageState extends State<MyHomePage>
137137
size: 18,),
138138
onTap: ()
139139
{
140-
_innerDrawerKey.currentState.close();
140+
_innerDrawerKey.currentState.toggle();
141141
},
142142
),
143143
),
@@ -465,7 +465,7 @@ class _MyHomePageState extends State<MyHomePage>
465465
RaisedButton(
466466
child:Text("open"),
467467
onPressed: (){
468-
_innerDrawerKey.currentState.open();
468+
_innerDrawerKey.currentState.toggle();
469469
},
470470
),
471471
],

lib/inner_drawer.dart

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,15 @@ class InnerDrawerState extends State<InnerDrawer> with SingleTickerProviderState
291291
{
292292
_controller.fling(velocity: 1);
293293
}
294-
294+
295+
/// Open or Close InnerDrawer
296+
void toggle()
297+
{
298+
if(_previouslyOpened)
299+
_controller.fling(velocity: 1);
300+
else
301+
_controller.fling(velocity: -1);
302+
}
295303

296304
final GlobalKey _gestureDetectorKey = GlobalKey();
297305

pubspec.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,4 +136,4 @@ packages:
136136
source: hosted
137137
version: "2.0.8"
138138
sdks:
139-
dart: ">=2.2.0 <3.0.0"
139+
dart: ">=2.2.2 <3.0.0"

pubspec.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
name: flutter_inner_drawer
22
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: 0.2.8
3+
version: 0.2.9
44
author: Antonino Di Natale <[email protected]>
55
homepage: https://github.com/Dn-a/flutter_inner_drawer
66

77
environment:
8-
sdk: ">=2.0.0-dev.68.0 <3.0.0"
8+
sdk: ">=2.0.0 <3.0.0"
99

1010
dependencies:
1111
flutter:

0 commit comments

Comments
 (0)