RhythmBox/lib/router.dart

37 lines
1.0 KiB
Dart
Raw Normal View History

2024-08-26 05:29:17 +00:00
import 'package:go_router/go_router.dart';
import 'package:rhythm_box/screens/explore.dart';
2024-08-27 06:48:31 +00:00
import 'package:rhythm_box/screens/player/view.dart';
2024-08-26 12:26:07 +00:00
import 'package:rhythm_box/screens/playlist/view.dart';
2024-08-26 05:29:17 +00:00
import 'package:rhythm_box/screens/settings.dart';
import 'package:rhythm_box/shells/nav_shell.dart';
final router = GoRouter(routes: [
ShellRoute(
builder: (context, state, child) => NavShell(child: child),
routes: [
GoRoute(
2024-08-27 06:48:31 +00:00
path: '/',
name: 'explore',
2024-08-26 05:29:17 +00:00
builder: (context, state) => const ExploreScreen(),
),
2024-08-27 06:35:16 +00:00
GoRoute(
2024-08-27 06:48:31 +00:00
path: '/playlist/:id',
name: 'playlistView',
2024-08-27 06:35:16 +00:00
builder: (context, state) => PlaylistViewScreen(
playlistId: state.pathParameters['id']!,
),
),
2024-08-26 05:29:17 +00:00
GoRoute(
2024-08-27 06:48:31 +00:00
path: '/settings',
name: 'settings',
2024-08-26 05:29:17 +00:00
builder: (context, state) => const SettingsScreen(),
),
],
),
2024-08-27 06:48:31 +00:00
GoRoute(
path: '/player',
name: 'player',
builder: (context, state) => const PlayerScreen(),
),
2024-08-26 05:29:17 +00:00
]);