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;
case -3:
_animateToHeight(
-1,
0,
duration: widget.controller.value.duration,
);
break;
@ -364,10 +364,12 @@ class ControllerData {
class MiniplayerController extends ValueNotifier<ControllerData> {
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;