2024-05-18 10:17:16 +00:00
|
|
|
import 'package:go_router/go_router.dart';
|
|
|
|
import 'package:solian/screens/account.dart';
|
2024-05-18 16:56:32 +00:00
|
|
|
import 'package:solian/screens/auth/signin.dart';
|
|
|
|
import 'package:solian/screens/auth/signup.dart';
|
2024-05-18 10:17:16 +00:00
|
|
|
import 'package:solian/screens/home.dart';
|
2024-05-19 10:01:00 +00:00
|
|
|
import 'package:solian/screens/posts/publish.dart';
|
2024-05-18 10:17:16 +00:00
|
|
|
import 'package:solian/shells/nav_shell.dart';
|
|
|
|
|
2024-05-18 16:56:32 +00:00
|
|
|
abstract class AppRouter {
|
2024-05-18 10:17:16 +00:00
|
|
|
static GoRouter instance = GoRouter(
|
|
|
|
routes: [
|
|
|
|
ShellRoute(
|
|
|
|
builder: (context, state, child) => NavShell(state: state, child: child),
|
|
|
|
routes: [
|
|
|
|
GoRoute(
|
|
|
|
path: "/",
|
|
|
|
name: "home",
|
|
|
|
builder: (context, state) => const HomeScreen(),
|
|
|
|
),
|
|
|
|
GoRoute(
|
|
|
|
path: "/account",
|
|
|
|
name: "account",
|
|
|
|
builder: (context, state) => const AccountScreen(),
|
|
|
|
),
|
2024-05-18 16:56:32 +00:00
|
|
|
GoRoute(
|
|
|
|
path: "/auth/sign-in",
|
|
|
|
name: "signin",
|
|
|
|
builder: (context, state) => const SignInScreen(),
|
|
|
|
),
|
|
|
|
GoRoute(
|
|
|
|
path: "/auth/sign-up",
|
|
|
|
name: "signup",
|
|
|
|
builder: (context, state) => const SignUpScreen(),
|
|
|
|
),
|
2024-05-18 10:17:16 +00:00
|
|
|
],
|
|
|
|
),
|
2024-05-19 10:01:00 +00:00
|
|
|
GoRoute(
|
|
|
|
path: "/posts/publish",
|
|
|
|
name: "postPublishing",
|
|
|
|
builder: (context, state) => const PostPublishingScreen(),
|
|
|
|
),
|
2024-05-18 10:17:16 +00:00
|
|
|
],
|
|
|
|
);
|
|
|
|
}
|