From f5edea4aa0d54cefff02d27c32bb5a4f8e5b5207 Mon Sep 17 00:00:00 2001 From: David <8vsxdxd@gmail.com> Date: Mon, 21 Sep 2020 13:58:35 +0200 Subject: [PATCH] Updated dismiss behaviour --- lib/miniplayer.dart | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/miniplayer.dart b/lib/miniplayer.dart index 11bb77a..5abbfd9 100644 --- a/lib/miniplayer.dart +++ b/lib/miniplayer.dart @@ -230,7 +230,7 @@ class _MiniplayerState extends State with TickerProviderStateMixin { } ///Determines whether the panel should be updated in height or discarded - void handleHeightChange() { + void handleHeightChange({bool animation = false}) { ///Drag above minHeight if (_dragHeight >= widget.minHeight) { heightNotifier.value = _dragHeight; @@ -249,7 +249,7 @@ class _MiniplayerState extends State with TickerProviderStateMixin { if (dragDownPercentage.value != percentageDown) dragDownPercentage.value = percentageDown; - if (percentageDown >= 1 && !dismissed) { + if (percentageDown >= 1 && animation && !dismissed) { if (widget.onDismiss != null) widget.onDismiss(); setState(() { dismissed = true; @@ -288,7 +288,7 @@ class _MiniplayerState extends State with TickerProviderStateMixin { _dragHeight = _sizeAnimation.value; - handleHeightChange(); + handleHeightChange(animation: true); }); animating = true;