animateToHeight method

void animateToHeight(
  1. {double? height,
  2. PanelState? state,
  3. Duration? duration}
)

Implementation

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;

  if (state != null)
    value = ControllerData(state.heightCode, duration);
  else {
    if (height! < 0) return;

    value = ControllerData(height.round(), duration);
  }

  if (valBefore == value) notifyListeners();
}