Skip to content

Commit

Permalink
Merge pull request #21 from alex-melnyk/feature/disable_gesture_option
Browse files Browse the repository at this point in the history
Feature/disable gesture option
  • Loading branch information
alex-melnyk authored Sep 26, 2021
2 parents 0dfcbc8 + 463e36c commit 570403e
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 11 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+1

* Disabling gestures fixed.

## 1.2.3

* "disabledGestures" option added to disable gestures.
Expand Down
2 changes: 1 addition & 1 deletion example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ packages:
path: ".."
relative: true
source: path
version: "1.2.2"
version: "1.2.3+1"
meta:
dependency: transitive
description:
Expand Down
2 changes: 0 additions & 2 deletions lib/flutter_advanced_drawer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,5 @@ library flutter_advanced_drawer;
import 'package:flutter/material.dart';

part 'src/controller.dart';

part 'src/value.dart';

part 'src/widget.dart';
20 changes: 13 additions & 7 deletions lib/src/widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -114,22 +114,29 @@ class _AdvancedDrawerState extends State<AdvancedDrawer>
return Material(
color: widget.backdropColor,
child: GestureDetector(
onHorizontalDragStart: widget.disableGestures?null:_handleDragStart,
onHorizontalDragUpdate: widget.disableGestures?null:_handleDragUpdate,
onHorizontalDragEnd: widget.disableGestures?null:_handleDragEnd,
onHorizontalDragCancel: widget.disableGestures?null:_handleDragCancel,
onHorizontalDragStart:
widget.disabledGestures ? null : _handleDragStart,
onHorizontalDragUpdate:
widget.disabledGestures ? null : _handleDragUpdate,
onHorizontalDragEnd: widget.disabledGestures ? null : _handleDragEnd,
onHorizontalDragCancel:
widget.disabledGestures ? null : _handleDragCancel,
child: Container(
color: Colors.transparent,
child: Stack(
children: <Widget>[
// -------- DRAWER
Align(
alignment: widget.rtlOpening ? Alignment.centerRight : Alignment.centerLeft,
alignment: widget.rtlOpening
? Alignment.centerRight
: Alignment.centerLeft,
child: FractionallySizedBox(
widthFactor: widget.openRatio,
child: ScaleTransition(
scale: _drawerScaleAnimation,
alignment: widget.rtlOpening ? Alignment.centerLeft : Alignment.centerRight,
alignment: widget.rtlOpening
? Alignment.centerLeft
: Alignment.centerRight,
child: widget.drawer,
),
),
Expand Down Expand Up @@ -206,7 +213,6 @@ class _AdvancedDrawerState extends State<AdvancedDrawer>
}

void _handleDragStart(DragStartDetails details) {

_captured = true;
_startPosition = details.globalPosition;
_offsetValue = _animationController.value;
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_advanced_drawer
description: An advanced drawer widget, that can be fully customized with size, text, color, radius of corners.
version: 1.2.3
version: 1.2.3+1
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 Down

0 comments on commit 570403e

Please sign in to comment.