The miniplayer can now only be dismissed if onDismiss is set

This commit is contained in:
David 2020-09-21 13:29:11 +02:00
parent bc6d580abd
commit 8136dd5c0c
1 changed files with 11 additions and 6 deletions

View File

@ -199,11 +199,12 @@ class _MiniplayerState extends State<Miniplayer> with TickerProviderStateMixin {
else
///DismissedPercentage > 0.2 -> dismiss
if (_percentageFromValueInRange(
min: widget.minHeight,
max: 0,
value: _dragHeight) >
snapPercentage) snap = SnapPosition.DISMISS;
if (widget.onDismiss != null &&
_percentageFromValueInRange(
min: widget.minHeight,
max: 0,
value: _dragHeight) >
snapPercentage) snap = SnapPosition.DISMISS;
}
///Snap to position
@ -230,11 +231,15 @@ class _MiniplayerState extends State<Miniplayer> with TickerProviderStateMixin {
///Determines whether the panel should be updated in height or discarded
void handleHeightChange() {
///Drag above minHeight
if (_dragHeight >= widget.minHeight) {
heightNotifier.value = _dragHeight;
if (dragDownPercentage.value != 0) dragDownPercentage.value = 0;
} else {
}
///Drag below minHeight
else if (widget.onDismiss != null) {
var percentageDown = _borderDouble(
minRange: 0,
maxRange: 1,