2024-03-17 20:22:46 +08:00
|
|
|
import 'package:go_router/go_router.dart';
|
2024-03-24 12:22:29 +08:00
|
|
|
import 'package:solaragent/models/feed.dart';
|
2024-03-17 20:22:46 +08:00
|
|
|
import 'package:solaragent/screens/account.dart';
|
2024-03-23 23:05:04 +08:00
|
|
|
import 'package:solaragent/screens/explore.dart';
|
2024-03-17 20:22:46 +08:00
|
|
|
import 'package:solaragent/screens/notifications.dart';
|
2024-03-24 22:57:12 +08:00
|
|
|
import 'package:solaragent/screens/posts/screen.dart';
|
2024-03-24 12:22:29 +08:00
|
|
|
import 'package:solaragent/screens/publish/comment_editor.dart';
|
2024-03-24 01:22:01 +08:00
|
|
|
import 'package:solaragent/screens/publish/moment_editor.dart';
|
2024-03-17 20:22:46 +08:00
|
|
|
|
|
|
|
final router = GoRouter(
|
|
|
|
routes: [
|
|
|
|
GoRoute(
|
|
|
|
path: '/',
|
2024-03-23 23:05:04 +08:00
|
|
|
builder: (context, state) => const ExploreScreen(),
|
2024-03-17 20:22:46 +08:00
|
|
|
),
|
|
|
|
GoRoute(
|
|
|
|
path: '/notifications',
|
|
|
|
builder: (context, state) => const NotificationScreen(),
|
|
|
|
),
|
|
|
|
GoRoute(
|
|
|
|
path: '/account',
|
|
|
|
builder: (context, state) => const AccountScreen(),
|
2024-03-24 01:22:01 +08:00
|
|
|
),
|
2024-03-24 22:57:12 +08:00
|
|
|
|
2024-03-24 01:22:01 +08:00
|
|
|
GoRoute(
|
2024-03-24 22:57:12 +08:00
|
|
|
path: '/post/new/moments',
|
2024-03-24 01:22:01 +08:00
|
|
|
builder: (context, state) => const MomentEditorScreen(),
|
|
|
|
),
|
2024-03-24 12:22:29 +08:00
|
|
|
GoRoute(
|
2024-03-24 22:57:12 +08:00
|
|
|
path: '/post/new/comments',
|
2024-03-24 12:22:29 +08:00
|
|
|
builder: (context, state) =>
|
|
|
|
CommentEditorScreen(parent: state.extra as Feed),
|
|
|
|
),
|
2024-03-24 22:57:12 +08:00
|
|
|
|
|
|
|
GoRoute(
|
|
|
|
path: '/post/:modelType/:alias',
|
|
|
|
builder: (context, state) => PostScreen(
|
|
|
|
modelType: state.pathParameters['modelType'] as String,
|
|
|
|
alias: state.pathParameters['alias'] as String,
|
|
|
|
),
|
|
|
|
),
|
2024-03-17 20:22:46 +08:00
|
|
|
],
|
2024-03-24 01:22:01 +08:00
|
|
|
);
|