From 2c249c502aaf6098ea44d784214d22af31d64868 Mon Sep 17 00:00:00 2001 From: Jaime Blasco Date: Wed, 15 Apr 2020 10:44:19 +0200 Subject: [PATCH] Prepare for 0.1.5 release --- CHANGELOG.md | 7 ++++--- README.md | 2 +- example/lib/main.dart | 3 ++- lib/src/bottom_sheet.dart | 4 +--- pubspec.yaml | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 61e030ea..b29283dd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ ## [0.1.4] - Clean code and fix small bugs -## [0.1.5] - Bugfixes -- fix assertion in CupertinoBottomSheet and BottomSheetRoute when using the CupetinoApp or WidgetsApp as root -- fix assertion when scrollController isn't used by the builder \ No newline at end of file +## [0.1.5] - Scroll improvements and bug fixes +- Support for closing a modal with a scroll view by dragging down fast. +- Fix assertion in CupertinoBottomSheet and BottomSheetRoute when using the CupetinoApp or WidgetsApp as root +- Fix assertion when scrollController isn't used by the builder \ No newline at end of file diff --git a/README.md b/README.md index eb5364ea..53b3a0db 100644 --- a/README.md +++ b/README.md @@ -187,7 +187,7 @@ Check in the example project `showAvatarModalBottomSheet` for how to create your ## Roadmap -- [ ] Support closing by dragging fast on a modal with a scroll view. +- [ X ] Support closing by dragging fast on a modal with a scroll view. - [ ] Improve animation curves when user is not dragging. diff --git a/example/lib/main.dart b/example/lib/main.dart index 05d8250f..e8feddf3 100644 --- a/example/lib/main.dart +++ b/example/lib/main.dart @@ -194,7 +194,8 @@ class _MyHomePageState extends State { scrollController: scrollController), )), ListTile( - title: Text('Cupertino Navigator + Scroll + WillPopScope'), + title: + Text('Cupertino Navigator + Scroll + WillPopScope'), onTap: () => showCupertinoModalBottomSheet( expand: true, context: context, diff --git a/lib/src/bottom_sheet.dart b/lib/src/bottom_sheet.dart index ac0a5422..a8c1e661 100644 --- a/lib/src/bottom_sheet.dart +++ b/lib/src/bottom_sheet.dart @@ -225,7 +225,6 @@ class _ModalBottomSheetState extends State } } - // As we cannot access the dragGesture detector of the scroll view // we can not know the DragDownDetails and therefore the end velocity. // VelocityTracker it is used to calculate the end velocity of the scroll @@ -257,8 +256,7 @@ class _ModalBottomSheetState extends State final offset = Offset(0, _scrollController.offset); _velocityTracker.addPosition(duration, offset); _handleDragUpdate(dragDetails.primaryDelta); - } - else if (isDragging) { + } else if (isDragging) { final velocity = _velocityTracker.getVelocity().pixelsPerSecond.dy; _handleDragEnd(velocity); } diff --git a/pubspec.yaml b/pubspec.yaml index 58066bdc..be4c1c12 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,5 +1,5 @@ name: modal_bottom_sheet -description: 'Create awesome and powerful modal bottom sheets. Material, Cupertino or create your own' +description: 'Create awesome and powerful modal bottom sheets. Material, Cupertino iOS 13 or create your own style' version: 0.1.5 homepage: 'https://github.com/jamesblasco/modal_bottom_sheet'