44 lines
1.3 KiB
Dart
44 lines
1.3 KiB
Dart
import 'package:go_router/go_router.dart';
|
|
import 'package:solaragent/models/feed.dart';
|
|
import 'package:solaragent/screens/account.dart';
|
|
import 'package:solaragent/screens/explore.dart';
|
|
import 'package:solaragent/screens/notifications.dart';
|
|
import 'package:solaragent/screens/posts/screen.dart';
|
|
import 'package:solaragent/screens/publish/comment_editor.dart';
|
|
import 'package:solaragent/screens/publish/moment_editor.dart';
|
|
|
|
final router = GoRouter(
|
|
routes: [
|
|
GoRoute(
|
|
path: '/',
|
|
builder: (context, state) => const ExploreScreen(),
|
|
),
|
|
GoRoute(
|
|
path: '/notifications',
|
|
builder: (context, state) => const NotificationScreen(),
|
|
),
|
|
GoRoute(
|
|
path: '/account',
|
|
builder: (context, state) => const AccountScreen(),
|
|
),
|
|
|
|
GoRoute(
|
|
path: '/post/new/moments',
|
|
builder: (context, state) => const MomentEditorScreen(),
|
|
),
|
|
GoRoute(
|
|
path: '/post/new/comments',
|
|
builder: (context, state) =>
|
|
CommentEditorScreen(parent: state.extra as Feed),
|
|
),
|
|
|
|
GoRoute(
|
|
path: '/post/:modelType/:alias',
|
|
builder: (context, state) => PostScreen(
|
|
modelType: state.pathParameters['modelType'] as String,
|
|
alias: state.pathParameters['alias'] as String,
|
|
),
|
|
),
|
|
],
|
|
);
|