Skip to content

Commit

Permalink
rollback issue #33
Browse files Browse the repository at this point in the history
  • Loading branch information
Dn-a committed Apr 29, 2020
1 parent 7693209 commit cf45073
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 10 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## [0.5.5+3] - 2020-04-29.

* Rollback issue #33.
* Fixed some problems.

## [0.5.5+2] - 2020-04-28.

* general improvements.
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# flutter_inner_drawer
[![pub package](https://img.shields.io/badge/pub-0.5.5+2-orange.svg)](https://pub.dartlang.org/packages/flutter_inner_drawer)
[![pub package](https://img.shields.io/badge/pub-0.5.5+3-orange.svg)](https://pub.dartlang.org/packages/flutter_inner_drawer)
[![Awesome Flutter](https://img.shields.io/badge/Awesome-Flutter-blue.svg?longCache=true&style=flat-square)](https://github.com/Solido/awesome-flutter#drawers)
[![Donate](https://img.shields.io/badge/Donate-PayPal-green.svg)](https://www.paypal.me/dnag88)

Expand All @@ -10,7 +10,7 @@ Inner Drawer is an easy way to create an internal side section (left/right) wher
Add this to your package's pubspec.yaml file:
```dart
dependencies:
flutter_inner_drawer: "^0.5.5+2"
flutter_inner_drawer: "^0.5.5+3"
```
## Demo
<div align="center">
Expand Down
Binary file not shown.
Binary file modified example/android/.gradle/5.6.2/fileHashes/fileHashes.bin
Binary file not shown.
2 changes: 1 addition & 1 deletion example/lib/example_3.dart
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ class _ExampleThreeState extends State<ExampleThree> {
if (a) {
myFocusNode2.requestFocus();
} else {
//myFocusNode.requestFocus();
myFocusNode.requestFocus();
}
},
);
Expand Down
14 changes: 8 additions & 6 deletions lib/inner_drawer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ class InnerDrawerState extends State<InnerDrawer>
void dispose() {
_historyEntry?.remove();
_controller.dispose();
_focusScopeNode.dispose();
super.dispose();
}

Expand Down Expand Up @@ -253,18 +254,18 @@ class InnerDrawerState extends State<InnerDrawer>
//_ensureHistoryEntry();
}

//final GlobalKey _drawerKey = GlobalKey();
final GlobalKey _drawerKey = GlobalKey();

double get _width {
return _initWidth;
}

/// get width of screen after initState
void _updateWidth(BuildContext context) {
void _updateWidth() {
WidgetsBinding.instance.addPostFrameCallback((_) {
//final RenderBox box = _drawerKey.currentContext.findRenderObject();
final RenderBox box = context.findRenderObject();
if (box != null && box.size != null)
final RenderBox box = _drawerKey.currentContext.findRenderObject();
//final RenderBox box = context.findRenderObject();
if (box != null && box.size != null && box.size.width > 300)
setState(() {
_initWidth = box.size.width;
});
Expand Down Expand Up @@ -509,6 +510,7 @@ class InnerDrawerState extends State<InnerDrawer>
assert(widget.borderRadius >= 0);

Widget container = Container(
key: _drawerKey,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(
widget.borderRadius * (1 - _controller.value)),
Expand Down Expand Up @@ -561,7 +563,7 @@ class InnerDrawerState extends State<InnerDrawer>
/// initialize the correct width
if (_initWidth == 400 ||
MediaQuery.of(context).orientation != _orientation) {
_updateWidth(context);
_updateWidth();
_orientation = MediaQuery.of(context).orientation;
}

Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: flutter_inner_drawer
description: Inner Drawer is an easy way to create an internal side section (left/right) where you can insert a list menu or other.
version: 0.5.5+2
version: 0.5.5+3
author: Antonino Di Natale <[email protected]>
homepage: https://github.com/Dn-a/flutter_inner_drawer

Expand Down

0 comments on commit cf45073

Please sign in to comment.