Commit 682243ef authored by Adam Barth's avatar Adam Barth

Merge pull request #1156 from abarth/edge_swipe

Drawer edge swipe convers entire screen
parents 4d696e62 1ef3f82e
...@@ -152,20 +152,27 @@ class DrawerControllerState extends State<DrawerController> { ...@@ -152,20 +152,27 @@ class DrawerControllerState extends State<DrawerController> {
} }
final AnimatedColorValue _color = new AnimatedColorValue(Colors.transparent, end: Colors.black54); final AnimatedColorValue _color = new AnimatedColorValue(Colors.transparent, end: Colors.black54);
final GlobalKey _gestureDetectorKey = new GlobalKey();
Widget build(BuildContext context) { Widget build(BuildContext context) {
HitTestBehavior behavior;
Widget child;
if (_performance.status == PerformanceStatus.dismissed) { if (_performance.status == PerformanceStatus.dismissed) {
behavior = HitTestBehavior.translucent; return new Align(
child = new Align(
alignment: const FractionalOffset(0.0, 0.5), alignment: const FractionalOffset(0.0, 0.5),
widthFactor: 1.0, child: new GestureDetector(
key: _gestureDetectorKey,
onHorizontalDragUpdate: _move,
onHorizontalDragEnd: _settle,
behavior: HitTestBehavior.translucent,
child: new Container(width: _kEdgeDragWidth) child: new Container(width: _kEdgeDragWidth)
)
); );
} else { } else {
_performance.updateVariable(_color); _performance.updateVariable(_color);
child = new RepaintBoundary( return new GestureDetector(
key: _gestureDetectorKey,
onHorizontalDragUpdate: _move,
onHorizontalDragEnd: _settle,
child: new RepaintBoundary(
child: new Stack(<Widget>[ child: new Stack(<Widget>[
new GestureDetector( new GestureDetector(
onTap: close, onTap: close,
...@@ -196,13 +203,8 @@ class DrawerControllerState extends State<DrawerController> { ...@@ -196,13 +203,8 @@ class DrawerControllerState extends State<DrawerController> {
) )
) )
]) ])
)
); );
} }
return new GestureDetector(
onHorizontalDragUpdate: _move,
onHorizontalDragEnd: _settle,
behavior: behavior,
child: child
);
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment