mirror of
https://github.com/KRTirtho/spotube.git
synced 2026-09-20 14:44:00 +00:00
Merge f2339bd9d3 into 69a310c78f
This commit is contained in:
commit
9d067abd9a
@ -28,26 +28,45 @@ class PlayerOverlay extends HookConsumerWidget {
|
|||||||
|
|
||||||
final panelController = ref.watch(playerOverlayControllerProvider);
|
final panelController = ref.watch(playerOverlayControllerProvider);
|
||||||
|
|
||||||
return SlidingUpPanel(
|
// [SlidingUpPanel] animates its own height between [minHeight] and
|
||||||
maxHeight: screenSize.height,
|
// [maxHeight] (the full screen height) while it is being opened/closed.
|
||||||
backdropEnabled: false,
|
// Since this widget sits as a plain child inside the [Scaffold]'s
|
||||||
minHeight: canShow ? 63 : 0,
|
// footers column, that transient height briefly exceeds the collapsed
|
||||||
onPanelSlide: (position) {
|
// [minHeight] slot it was given, overflowing the footers column by a
|
||||||
final invertedPosition = 1 - position;
|
// few pixels. [OverflowBox] lets the panel keep painting at its actual
|
||||||
ref.read(navigationPanelHeight.notifier).state = 50 * invertedPosition;
|
// (larger) size while reporting only the fixed collapsed height to its
|
||||||
},
|
// parent, so the outer layout never overflows.
|
||||||
controller: panelController,
|
return SizedBox(
|
||||||
color: Colors.transparent,
|
height: canShow ? 63 : 0,
|
||||||
parallaxEnabled: true,
|
width: screenSize.width,
|
||||||
renderPanelSheet: false,
|
child: OverflowBox(
|
||||||
header: SizedBox(
|
maxHeight: screenSize.height,
|
||||||
height: 63,
|
alignment: Alignment.bottomCenter,
|
||||||
width: screenSize.width,
|
child: SlidingUpPanel(
|
||||||
child: PlayerOverlayCollapsedSection(panelController: panelController),
|
maxHeight: screenSize.height,
|
||||||
),
|
backdropEnabled: false,
|
||||||
panelBuilder: (scrollController) => PlayerView(
|
minHeight: canShow ? 63 : 0,
|
||||||
panelController: panelController,
|
onPanelSlide: (position) {
|
||||||
scrollController: scrollController,
|
final invertedPosition = 1 - position;
|
||||||
|
ref.read(navigationPanelHeight.notifier).state =
|
||||||
|
50 * invertedPosition;
|
||||||
|
},
|
||||||
|
controller: panelController,
|
||||||
|
color: Colors.transparent,
|
||||||
|
parallaxEnabled: true,
|
||||||
|
renderPanelSheet: false,
|
||||||
|
header: SizedBox(
|
||||||
|
height: 63,
|
||||||
|
width: screenSize.width,
|
||||||
|
child: PlayerOverlayCollapsedSection(
|
||||||
|
panelController: panelController,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
panelBuilder: (scrollController) => PlayerView(
|
||||||
|
panelController: panelController,
|
||||||
|
scrollController: scrollController,
|
||||||
|
),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user