Skip to content

Commit

Permalink
disabledGestures option added.
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-melnyk committed Jul 21, 2021
1 parent 3568011 commit 4165ab3
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 1.2.3

* "disabledGestures" option added to disable gestures.

## 1.2.2

* Hidden drawer content with rtlOpening (true) fixed.
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ An advanced drawer widget, that can be fully customized with size, text, color,
|`childDecoration`|Child container decoration|*BoxDecoration*|Shadow, BorderRadius|
|`animateChildDecoration`|Indicates that [childDecoration] might be animated or not.|*bool*|true|
|`rtlOpening`|Opening from Right-to-left.|*bool*|false|
|`disabledGestures`|Disable gestures.|*bool*|false|

## Preview
| Preview Tap | Preview Gesture |
Expand Down
1 change: 1 addition & 0 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ class _HomeScreenState extends State<HomeScreen> {
animationDuration: const Duration(milliseconds: 300),
animateChildDecoration: true,
rtlOpening: false,
disabledGestures: false,
childDecoration: const BoxDecoration(
// NOTICE: Uncomment if you want to add shadow behind the page.
// Keep in mind that it may cause animation jerks.
Expand Down
6 changes: 6 additions & 0 deletions lib/src/widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ class AdvancedDrawer extends StatefulWidget {
this.childDecoration,
this.animateChildDecoration = true,
this.rtlOpening = false,
this.disabledGestures = false,
}) : super(key: key);

/// Child widget. (Usually widget that represent a screen)
Expand Down Expand Up @@ -47,6 +48,9 @@ class AdvancedDrawer extends StatefulWidget {
/// Opening from Right-to-left.
final bool rtlOpening;

/// Disable gestures.
final bool disabledGestures;

@override
_AdvancedDrawerState createState() => _AdvancedDrawerState();
}
Expand Down Expand Up @@ -202,6 +206,8 @@ class _AdvancedDrawerState extends State<AdvancedDrawer>
}

void _handleDragStart(DragStartDetails details) {
if (widget.disabledGestures) return;

_captured = true;
_startPosition = details.globalPosition;
_offsetValue = _animationController.value;
Expand Down
4 changes: 2 additions & 2 deletions pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: flutter_advanced_drawer
description: An advanced drawer widget, that can be fully customized with size, text, color, radius of corners.
version: 1.2.2
version: 1.2.3
homepage: https://github.com/alex-melnyk/flutter_advanced_drawer
repository: https://github.com/alex-melnyk/flutter_advanced_drawer
issue_tracker: https://github.com/alex-melnyk/flutter_advanced_drawer/issues
Expand All @@ -13,4 +13,4 @@ dependencies:
flutter:
sdk: flutter

flutter:
flutter:

0 comments on commit 4165ab3

Please sign in to comment.