diff --git a/lib/direct_select_container.dart b/lib/direct_select_container.dart index 564a63c..363e293 100644 --- a/lib/direct_select_container.dart +++ b/lib/direct_select_container.dart @@ -182,7 +182,9 @@ class DirectSelectContainerState extends State Rect? rect = RectGetter.getRectFromKey( _currentList.paddingItemController.paddingGlobalKey); if (rect != null) { - paddingLeft = rect.left; + // paddingLeft = rect.left; + paddingLeft = 0; + //will leave menus as centered. } } diff --git a/lib/direct_select_list.dart b/lib/direct_select_list.dart index 18b7c52..127eeb5 100644 --- a/lib/direct_select_list.dart +++ b/lib/direct_select_list.dart @@ -180,19 +180,46 @@ class DirectSelectState extends State> { animatedStateKey.currentState ?.runScaleTransition(reverse: true); }, - onVerticalDragEnd: (dragDetails) async { + // onVerticalDragEnd: (dragDetails) async { + // debugPrint('DirectSelectList onVerticalDragEnd'); + // transitionEnded = true; + // _dragEnd(); + // }, + // onHorizontalDragEnd: (horizontalDetails) async { + // debugPrint('DirectSelectList onVerticalDragEnd'); + // transitionEnded = true; + // _dragEnd(); + // }, + // onVerticalDragUpdate: (dragInfo) { + // debugPrint('DirectSelectList onVerticalDragUpdate'); + // if (!_isShowUpAnimationRunning) { + // _showListOverlay(dragInfo.primaryDelta); + // } + // }, + onPanEnd: (dragInfo) async { + debugPrint('DirectSelectList onPanEnd'); transitionEnded = true; _dragEnd(); }, - onHorizontalDragEnd: (horizontalDetails) async { - transitionEnded = true; - _dragEnd(); - }, - onVerticalDragUpdate: (dragInfo) { - if (!_isShowUpAnimationRunning) { - _showListOverlay(dragInfo.primaryDelta); + onPanUpdate: (dragInfo) { + if (dragInfo.delta.dx > 0) + print("Dragging in +X direction"); + else + print("Dragging in -X direction"); + + if (dragInfo.delta.dy > 0) { + print("Dragging in +Y direction"); + if (!_isShowUpAnimationRunning) { + _showListOverlay(dragInfo.delta.dy); + } + } else { + print("Dragging in -Y direction"); + if (!_isShowUpAnimationRunning) { + _showListOverlay(dragInfo.delta.dy); + } } - }); + }, + ); }); } diff --git a/pubspec.yaml b/pubspec.yaml index 5dded37..9240bf6 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -9,11 +9,11 @@ environment: dependencies: flutter: sdk: flutter - rect_getter: ^1.0.0 + rect_getter: ^1.1.0 dev_dependencies: flutter_test: sdk: flutter flutter: - uses-material-design: true \ No newline at end of file + uses-material-design: true