Solian/lib/router.dart

28 lines
733 B
Dart
Raw Normal View History

2024-04-12 16:38:20 +00:00
import 'package:go_router/go_router.dart';
import 'package:solian/screens/account.dart';
2024-04-12 16:38:20 +00:00
import 'package:solian/screens/explore.dart';
2024-04-13 17:07:57 +00:00
import 'package:solian/screens/posts/screen.dart';
2024-04-12 16:38:20 +00:00
final router = GoRouter(
routes: [
GoRoute(
path: '/',
name: 'explore',
builder: (context, state) => const ExploreScreen(),
),
GoRoute(
path: '/account',
name: 'account',
builder: (context, state) => const AccountScreen(),
),
2024-04-13 17:07:57 +00:00
GoRoute(
path: '/posts/:dataset/:alias',
name: 'posts.screen',
builder: (context, state) => PostScreen(
alias: state.pathParameters['alias'] as String,
dataset: state.pathParameters['dataset'] as String,
),
),
2024-04-12 16:38:20 +00:00
],
);