Created project base structure, state management, router and login
This commit is contained in:
6
lib/router/paths.dart
Normal file
6
lib/router/paths.dart
Normal file
@@ -0,0 +1,6 @@
|
||||
class RoutesPaths {
|
||||
static const connect = "/connect";
|
||||
static const links = "/links";
|
||||
static const search = "/search";
|
||||
static const settings = "/settings";
|
||||
}
|
||||
59
lib/router/routes.dart
Normal file
59
lib/router/routes.dart
Normal file
@@ -0,0 +1,59 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
|
||||
import 'package:my_linkding/screens/connect/ui/connect.dart';
|
||||
import 'package:my_linkding/screens/links/ui/links.dart';
|
||||
import 'package:my_linkding/screens/search/ui/search.dart';
|
||||
import 'package:my_linkding/screens/settings/ui/settings.dart';
|
||||
import 'package:my_linkding/widgets/layout.dart';
|
||||
|
||||
import 'package:my_linkding/router/paths.dart';
|
||||
|
||||
final rootNavigatorKey = GlobalKey<NavigatorState>();
|
||||
final linksNavigatorKey = GlobalKey<NavigatorState>();
|
||||
final searchNavigatorKey = GlobalKey<NavigatorState>();
|
||||
final settingsNavigatorKey = GlobalKey<NavigatorState>();
|
||||
|
||||
final List<RouteBase> appRoutes = [
|
||||
GoRoute(
|
||||
path: RoutesPaths.connect,
|
||||
builder: (context, state) => const Connect(),
|
||||
),
|
||||
StatefulShellRoute.indexedStack(
|
||||
builder: (context, state, navigationShell) => Layout(
|
||||
navigationShell: navigationShell,
|
||||
),
|
||||
branches: [
|
||||
StatefulShellBranch(
|
||||
navigatorKey: linksNavigatorKey,
|
||||
initialLocation: RoutesPaths.links,
|
||||
routes: [
|
||||
GoRoute(
|
||||
path: RoutesPaths.links,
|
||||
builder: (context, state) => const Links(),
|
||||
),
|
||||
],
|
||||
),
|
||||
StatefulShellBranch(
|
||||
navigatorKey: searchNavigatorKey,
|
||||
initialLocation: RoutesPaths.search,
|
||||
routes: [
|
||||
GoRoute(
|
||||
path: RoutesPaths.search,
|
||||
builder: (context, state) => const Search(),
|
||||
),
|
||||
],
|
||||
),
|
||||
StatefulShellBranch(
|
||||
navigatorKey: settingsNavigatorKey,
|
||||
initialLocation: RoutesPaths.settings,
|
||||
routes: [
|
||||
GoRoute(
|
||||
path: RoutesPaths.settings,
|
||||
builder: (context, state) => const Settings(),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
];
|
||||
Reference in New Issue
Block a user