From 66df08ad89f306b697e4829c52e64e767709027e Mon Sep 17 00:00:00 2001 From: "jake.lee" Date: Fri, 28 Dec 2018 00:59:45 +0900 Subject: [PATCH] improve tap action mainview in Slidable - if when open slide layout, tap mainview, close slide change file: slidable.dart --- lib/src/widgets/slidable.dart | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/lib/src/widgets/slidable.dart b/lib/src/widgets/slidable.dart index 309f3c24..7209efa9 100644 --- a/lib/src/widgets/slidable.dart +++ b/lib/src/widgets/slidable.dart @@ -1171,7 +1171,19 @@ class SlidableState extends State onVerticalDragUpdate: directionIsXAxis ? null : _handleDragUpdate, onVerticalDragEnd: directionIsXAxis ? null : _handleDragEnd, behavior: HitTestBehavior.opaque, - child: content, + child: new GestureDetector( + onTap: () { + close(); + if (content is MainViewInSlidable) { + (content as MainViewInSlidable).callCloseOnTap(); + } + }, + child: content, + ), ); } } + +abstract class MainViewInSlidable { + void callCloseOnTap(); +}