From 9c944d6230cbc30665bcb126acd5da3ba2e1d591 Mon Sep 17 00:00:00 2001 From: David <8vsxdxd@gmail.com> Date: Wed, 7 Oct 2020 16:48:23 +0200 Subject: [PATCH] Adds error messages and fixes a bug --- lib/miniplayer.dart | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/lib/miniplayer.dart b/lib/miniplayer.dart index d02d0f5..031f925 100644 --- a/lib/miniplayer.dart +++ b/lib/miniplayer.dart @@ -123,7 +123,7 @@ class _MiniplayerState extends State with TickerProviderStateMixin { break; case -3: _animateToHeight( - -1, + 0, duration: widget.controller.value.duration, ); break; @@ -364,10 +364,12 @@ class ControllerData { class MiniplayerController extends ValueNotifier { MiniplayerController() : super(null); - void animateToHeight( - {double height, PanelState state, Duration duration}) { - if (height == null && state == null) return; - if (height != null && state != null) return; + void animateToHeight({double height, PanelState state, Duration duration}) { + if (height == null && state == null) + throw ("Miniplayer: One of the two parameters, height or status, is required."); + + if (height != null && state != null) + throw ("Miniplayer: Only one of the two parameters, height or status, can be specified."); ControllerData valBefore = value;