Initial (redacted) commit.

This commit is contained in:
mustard 2024-08-26 00:34:20 +02:00
commit 655f8a036a
368 changed files with 20949 additions and 0 deletions

View file

@ -0,0 +1,57 @@
import 'package:flutter/material.dart';
import 'package:go_router/go_router.dart';
import 'package:habitrack_app/infrastructure/bottom_navigation.dart';
import 'package:habitrack_app/pages/dashboard_page.dart';
import 'package:habitrack_app/pages/widget_page.dart';
// navigators, root and each destination of bottom navigation bar
final _rootNavigatorKey = GlobalKey<NavigatorState>();
final _shellNavigatorWidgetWallKey =
GlobalKey<NavigatorState>(debugLabel: 'widgetWall');
final _shellNavigatorDashboardKey =
GlobalKey<NavigatorState>(debugLabel: 'dashboard');
const String _widgetWallPath = '/widgetWall';
const String _dashboardPath = '/dashboard';
final goRouter = GoRouter(
initialLocation: _widgetWallPath,
navigatorKey: _rootNavigatorKey,
debugLogDiagnostics: true,
routes: [
StatefulShellRoute.indexedStack(
builder: (context, state, navigationShell) {
return ScaffoldWithBottomNavigationBar(
navigationShell: navigationShell,
);
},
branches: [
StatefulShellBranch(
navigatorKey: _shellNavigatorWidgetWallKey,
routes: [
GoRoute(
path: _widgetWallPath,
pageBuilder: (context, state) => const NoTransitionPage(
child: WidgetPage(),
),
),
],
),
StatefulShellBranch(
navigatorKey: _shellNavigatorDashboardKey,
routes: [
GoRoute(
path: _dashboardPath,
pageBuilder: (context, state) => const NoTransitionPage(
child: DashboardPage(),
),
),
],
),
],
),
],
);