mirror of
https://github.com/gabehf/Fladder.git
synced 2026-03-07 21:48:14 -08:00
fix: Hide duplicate floating player in phone layout (#218)
Co-authored-by: PartyDonut <PartyDonut@users.noreply.github.com>
This commit is contained in:
parent
fe96c7e258
commit
cf53f02d90
5 changed files with 16 additions and 2 deletions
|
|
@ -160,6 +160,8 @@ class _LibrarySearchScreenState extends ConsumerState<LibrarySearchScreen> {
|
|||
child: Scaffold(
|
||||
extendBody: true,
|
||||
extendBodyBehindAppBar: true,
|
||||
floatingActionButtonAnimator:
|
||||
playerState == VideoPlayerState.minimized ? FloatingActionButtonAnimator.noAnimation : null,
|
||||
floatingActionButtonLocation:
|
||||
playerState == VideoPlayerState.minimized ? FloatingActionButtonLocation.centerFloat : null,
|
||||
floatingActionButton: switch (playerState) {
|
||||
|
|
|
|||
|
|
@ -78,6 +78,8 @@ class _DetailScaffoldState extends ConsumerState<DetailScaffold> {
|
|||
},
|
||||
refreshOnStart: true,
|
||||
child: Scaffold(
|
||||
floatingActionButtonAnimator:
|
||||
playerState == VideoPlayerState.minimized ? FloatingActionButtonAnimator.noAnimation : null,
|
||||
floatingActionButtonLocation: FloatingActionButtonLocation.centerFloat,
|
||||
floatingActionButton: switch (playerState) {
|
||||
VideoPlayerState.minimized => const Padding(
|
||||
|
|
|
|||
|
|
@ -19,6 +19,8 @@ class NestedScaffold extends ConsumerWidget {
|
|||
return Card(
|
||||
child: Scaffold(
|
||||
backgroundColor: Colors.transparent,
|
||||
floatingActionButtonAnimator:
|
||||
playerState == VideoPlayerState.minimized ? FloatingActionButtonAnimator.noAnimation : null,
|
||||
floatingActionButtonLocation: FloatingActionButtonLocation.centerFloat,
|
||||
floatingActionButton: switch (AdaptiveLayout.layoutOf(context)) {
|
||||
ViewSize.phone => null,
|
||||
|
|
|
|||
|
|
@ -75,7 +75,8 @@ class _CurrentlyPlayingBarState extends ConsumerState<FloatingPlayerBar> {
|
|||
fladderSnackbar(context, title: "Swipe up/down to open/close the player");
|
||||
},
|
||||
child: Card(
|
||||
elevation: 3,
|
||||
elevation: 5,
|
||||
color: Theme.of(context).colorScheme.primaryContainer,
|
||||
child: ConstrainedBox(
|
||||
constraints: const BoxConstraints(minHeight: 50, maxHeight: 85),
|
||||
child: LayoutBuilder(builder: (context, constraints) {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'package:auto_route/auto_route.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
|
||||
import 'package:fladder/models/media_playback_model.dart';
|
||||
|
|
@ -53,6 +54,8 @@ class _NavigationScaffoldState extends ConsumerState<NavigationScaffold> {
|
|||
final playerState = ref.watch(mediaPlaybackProvider.select((value) => value.state));
|
||||
final views = ref.watch(viewsProvider.select((value) => value.views));
|
||||
|
||||
final isHomeRoutes = homeRoutes.any((element) => element.name.contains(context.router.current.name));
|
||||
|
||||
return PopScope(
|
||||
canPop: currentIndex == 0,
|
||||
onPopInvokedWithResult: (didPop, result) {
|
||||
|
|
@ -65,9 +68,13 @@ class _NavigationScaffoldState extends ConsumerState<NavigationScaffold> {
|
|||
appBar: const FladderAppBar(),
|
||||
extendBodyBehindAppBar: true,
|
||||
extendBody: true,
|
||||
floatingActionButtonAnimator:
|
||||
playerState == VideoPlayerState.minimized ? FloatingActionButtonAnimator.noAnimation : null,
|
||||
floatingActionButtonLocation:
|
||||
playerState == VideoPlayerState.minimized ? FloatingActionButtonLocation.centerFloat : null,
|
||||
floatingActionButton: AdaptiveLayout.layoutModeOf(context) == LayoutMode.single
|
||||
floatingActionButton: AdaptiveLayout.layoutModeOf(context) == LayoutMode.single &&
|
||||
AdaptiveLayout.viewSizeOf(context) == ViewSize.phone &&
|
||||
isHomeRoutes
|
||||
? switch (playerState) {
|
||||
VideoPlayerState.minimized => const Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 8),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue