[Bugfix] Properly show FAB in ScreenLayout.dual

This commit is contained in:
PartyDonut 2024-10-06 19:49:51 +02:00
parent aaa6a737cb
commit c4f33e5039
3 changed files with 3 additions and 12 deletions

View file

@ -139,7 +139,7 @@ class _NavigationBodyState extends ConsumerState<NavigationBody> {
}, },
icon: const Icon(IconsaxBold.menu), icon: const Icon(IconsaxBold.menu),
), ),
if (AdaptiveLayout.of(context).isDesktop) ...[ if (AdaptiveLayout.of(context).size == ScreenLayout.dual) ...[
const SizedBox(height: 8), const SizedBox(height: 8),
AnimatedFadeSize( AnimatedFadeSize(
child: AnimatedSwitcher( child: AnimatedSwitcher(

View file

@ -92,7 +92,7 @@ class NestedNavigationDrawer extends ConsumerWidget {
), ),
...views.map((library) => DrawerListButton( ...views.map((library) => DrawerListButton(
label: library.name, label: library.name,
selected: checkLibrary(context, library.id), selected: context.router.currentUrl.contains(library.id),
actions: [ actions: [
ItemActionButton( ItemActionButton(
label: Text(context.localized.scanLibrary), label: Text(context.localized.scanLibrary),
@ -151,13 +151,4 @@ class NestedNavigationDrawer extends ConsumerWidget {
], ],
); );
} }
bool checkLibrary(BuildContext context, String id) {
try {
return context.router.current.name == LibrarySearchRoute().routeName &&
(context.routeData.queryParams.isNotEmpty && context.routeData.queryParams.getString('parentId') == id);
} catch (e) {
return false;
}
}
} }

View file

@ -65,7 +65,7 @@ class _NavigationScaffoldState extends ConsumerState<NavigationScaffold> {
extendBody: true, extendBody: true,
floatingActionButtonLocation: floatingActionButtonLocation:
playerState == VideoPlayerState.minimized ? FloatingActionButtonLocation.centerFloat : null, playerState == VideoPlayerState.minimized ? FloatingActionButtonLocation.centerFloat : null,
floatingActionButton: AdaptiveLayout.of(context).layout == LayoutState.phone floatingActionButton: AdaptiveLayout.of(context).size == ScreenLayout.single
? switch (playerState) { ? switch (playerState) {
VideoPlayerState.minimized => const Padding( VideoPlayerState.minimized => const Padding(
padding: EdgeInsets.symmetric(horizontal: 8), padding: EdgeInsets.symmetric(horizontal: 8),