Adds error messages and fixes a bug

This commit is contained in:
David 2020-10-07 16:48:23 +02:00
parent de7e89f8cf
commit 9c944d6230
1 changed files with 7 additions and 5 deletions

View File

@ -123,7 +123,7 @@ class _MiniplayerState extends State<Miniplayer> with TickerProviderStateMixin {
break; break;
case -3: case -3:
_animateToHeight( _animateToHeight(
-1, 0,
duration: widget.controller.value.duration, duration: widget.controller.value.duration,
); );
break; break;
@ -364,10 +364,12 @@ class ControllerData {
class MiniplayerController extends ValueNotifier<ControllerData> { class MiniplayerController extends ValueNotifier<ControllerData> {
MiniplayerController() : super(null); MiniplayerController() : super(null);
void animateToHeight( void animateToHeight({double height, PanelState state, Duration duration}) {
{double height, PanelState state, Duration duration}) { if (height == null && state == null)
if (height == null && state == null) return; throw ("Miniplayer: One of the two parameters, height or status, is required.");
if (height != null && state != null) return;
if (height != null && state != null)
throw ("Miniplayer: Only one of the two parameters, height or status, can be specified.");
ControllerData valBefore = value; ControllerData valBefore = value;