Skip to content

Commit 11c4d49

Browse files
authored
Merge pull request #32 from alex-melnyk/bugfix/drawer_stuck_on_drag_end
Bugfix/drawer stuck on drag end
2 parents 3a2c1f9 + 0b685ee commit 11c4d49

File tree

9 files changed

+37
-19
lines changed

9 files changed

+37
-19
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 1.3.2
2+
3+
* Drawer stuck on back drag fixed.
4+
15
## 1.3.1
26

37
* The openScale parameter added to manage child scale.

example/ios/Flutter/AppFrameworkInfo.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@
2121
<key>CFBundleVersion</key>
2222
<string>1.0</string>
2323
<key>MinimumOSVersion</key>
24-
<string>8.0</string>
24+
<string>9.0</string>
2525
</dict>
2626
</plist>

example/ios/Runner.xcodeproj/project.pbxproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@
154154
97C146E61CF9000F007C117D /* Project object */ = {
155155
isa = PBXProject;
156156
attributes = {
157-
LastUpgradeCheck = 1020;
157+
LastUpgradeCheck = 1300;
158158
ORGANIZATIONNAME = "";
159159
TargetAttributes = {
160160
97C146ED1CF9000F007C117D = {

example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "1020"
3+
LastUpgradeVersion = "1300"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"

example/pubspec.lock

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ packages:
77
name: characters
88
url: "https://pub.dartlang.org"
99
source: hosted
10-
version: "1.1.0"
10+
version: "1.2.0"
1111
collection:
1212
dependency: transitive
1313
description:
@@ -26,14 +26,21 @@ packages:
2626
path: ".."
2727
relative: true
2828
source: path
29-
version: "1.3.1"
29+
version: "1.3.2"
30+
material_color_utilities:
31+
dependency: transitive
32+
description:
33+
name: material_color_utilities
34+
url: "https://pub.dartlang.org"
35+
source: hosted
36+
version: "0.1.3"
3037
meta:
3138
dependency: transitive
3239
description:
3340
name: meta
3441
url: "https://pub.dartlang.org"
3542
source: hosted
36-
version: "1.3.0"
43+
version: "1.7.0"
3744
sky_engine:
3845
dependency: transitive
3946
description: flutter
@@ -52,6 +59,6 @@ packages:
5259
name: vector_math
5360
url: "https://pub.dartlang.org"
5461
source: hosted
55-
version: "2.1.0"
62+
version: "2.1.1"
5663
sdks:
57-
dart: ">=2.12.0 <3.0.0"
64+
dart: ">=2.14.0 <3.0.0"

lib/src/controller.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,13 @@ class AdvancedDrawerController extends ValueNotifier<AdvancedDrawerValue> {
99
/// Shows drawer.
1010
void showDrawer() {
1111
value = AdvancedDrawerValue.visible();
12+
notifyListeners();
1213
}
1314

1415
/// Hides drawer.
1516
void hideDrawer() {
1617
value = AdvancedDrawerValue.hidden();
18+
notifyListeners();
1719
}
1820

1921
/// Toggles drawer.

lib/src/widget.dart

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -73,15 +73,15 @@ class _AdvancedDrawerState extends State<AdvancedDrawer>
7373
late final Animation<Decoration> _childDecorationAnimation;
7474
late double _offsetValue;
7575
late Offset _freshPosition;
76-
Offset? _startPosition;
7776
bool _captured = false;
77+
Offset? _startPosition;
7878

7979
@override
8080
void initState() {
8181
super.initState();
8282

8383
_controller = widget.controller ?? AdvancedDrawerController();
84-
_controller.addListener(handleControllerChanged);
84+
_controller.addListener(_handleControllerChanged);
8585

8686
_animationController = widget.animationController ??
8787
AnimationController(
@@ -135,7 +135,6 @@ class _AdvancedDrawerState extends State<AdvancedDrawer>
135135
color: Colors.transparent,
136136
child: Stack(
137137
children: <Widget>[
138-
// -------- DRAWER
139138
Align(
140139
alignment: widget.rtlOpening
141140
? Alignment.centerRight
@@ -151,7 +150,6 @@ class _AdvancedDrawerState extends State<AdvancedDrawer>
151150
),
152151
),
153152
),
154-
// -------- CHILD
155153
SlideTransition(
156154
position: _childSlideAnimation,
157155
textDirection:
@@ -216,7 +214,7 @@ class _AdvancedDrawerState extends State<AdvancedDrawer>
216214
);
217215
}
218216

219-
void handleControllerChanged() {
217+
void _handleControllerChanged() {
220218
_controller.value.visible
221219
? _animationController.forward()
222220
: _animationController.reverse();
@@ -268,7 +266,7 @@ class _AdvancedDrawerState extends State<AdvancedDrawer>
268266

269267
@override
270268
void dispose() {
271-
_controller.removeListener(handleControllerChanged);
269+
_controller.removeListener(_handleControllerChanged);
272270

273271
if (widget.controller == null) {
274272
_controller.dispose();

pubspec.lock

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ packages:
77
name: characters
88
url: "https://pub.dartlang.org"
99
source: hosted
10-
version: "1.1.0"
10+
version: "1.2.0"
1111
collection:
1212
dependency: transitive
1313
description:
@@ -34,13 +34,20 @@ packages:
3434
url: "https://pub.dartlang.org"
3535
source: hosted
3636
version: "1.0.1"
37+
material_color_utilities:
38+
dependency: transitive
39+
description:
40+
name: material_color_utilities
41+
url: "https://pub.dartlang.org"
42+
source: hosted
43+
version: "0.1.3"
3744
meta:
3845
dependency: transitive
3946
description:
4047
name: meta
4148
url: "https://pub.dartlang.org"
4249
source: hosted
43-
version: "1.3.0"
50+
version: "1.7.0"
4451
sky_engine:
4552
dependency: transitive
4653
description: flutter
@@ -59,6 +66,6 @@ packages:
5966
name: vector_math
6067
url: "https://pub.dartlang.org"
6168
source: hosted
62-
version: "2.1.0"
69+
version: "2.1.1"
6370
sdks:
64-
dart: ">=2.12.0 <3.0.0"
71+
dart: ">=2.14.0 <3.0.0"

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: flutter_advanced_drawer
22
description: An advanced drawer widget, that can be fully customized with size, text, color, radius of corners.
3-
version: 1.3.1
3+
version: 1.3.2
44
homepage: https://github.com/alex-melnyk/flutter_advanced_drawer
55
repository: https://github.com/alex-melnyk/flutter_advanced_drawer
66
issue_tracker: https://github.com/alex-melnyk/flutter_advanced_drawer/issues

0 commit comments

Comments
 (0)