🐛 Fix bottom navigation everywhere
This commit is contained in:
@ -3,6 +3,7 @@ import 'package:get/get.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
import 'package:solian/router.dart';
|
||||
import 'package:solian/theme.dart';
|
||||
import 'package:solian/widgets/navigation/app_navigation.dart';
|
||||
import 'package:solian/widgets/prev_page.dart';
|
||||
import 'package:solian/widgets/navigation/app_navigation_bottom_bar.dart';
|
||||
import 'package:solian/widgets/navigation/app_navigation_rail.dart';
|
||||
@ -11,6 +12,8 @@ import 'package:solian/widgets/sidebar/sidebar_placeholder.dart';
|
||||
class NavShell extends StatelessWidget {
|
||||
final bool showAppBar;
|
||||
final bool showSidebar;
|
||||
final bool showNavigation;
|
||||
final bool? showBottomNavigation;
|
||||
final GoRouterState state;
|
||||
final Widget child;
|
||||
|
||||
@ -23,6 +26,8 @@ class NavShell extends StatelessWidget {
|
||||
required this.state,
|
||||
this.showAppBar = true,
|
||||
this.showSidebar = true,
|
||||
this.showNavigation = true,
|
||||
this.showBottomNavigation,
|
||||
this.sidebarFirst = false,
|
||||
this.sidebar,
|
||||
});
|
||||
@ -47,6 +52,11 @@ class NavShell extends StatelessWidget {
|
||||
Widget build(BuildContext context) {
|
||||
final canPop = AppRouter.instance.canPop();
|
||||
|
||||
final routeName =
|
||||
AppRouter.instance.routerDelegate.currentConfiguration.last.route.name;
|
||||
final showBottom = showBottomNavigation ??
|
||||
AppNavigation.destinationPages.contains(routeName);
|
||||
|
||||
return Scaffold(
|
||||
appBar: showAppBar
|
||||
? AppBar(
|
||||
@ -58,14 +68,16 @@ class NavShell extends StatelessWidget {
|
||||
automaticallyImplyLeading: false,
|
||||
)
|
||||
: null,
|
||||
bottomNavigationBar: SolianTheme.isLargeScreen(context)
|
||||
bottomNavigationBar: (SolianTheme.isLargeScreen(context) ||
|
||||
!(showNavigation && showBottom))
|
||||
? null
|
||||
: const AppNavigationBottomBar(),
|
||||
body: SolianTheme.isLargeScreen(context)
|
||||
? Row(
|
||||
children: [
|
||||
const AppNavigationRail(),
|
||||
const VerticalDivider(thickness: 0.3, width: 1),
|
||||
if (showNavigation) const AppNavigationRail(),
|
||||
if (showNavigation)
|
||||
const VerticalDivider(thickness: 0.3, width: 1),
|
||||
if (showSidebar && sidebarFirst)
|
||||
...buildContent(context).reversed
|
||||
else if (showSidebar)
|
||||
|
Reference in New Issue
Block a user