33 lines
1001 B
Dart
33 lines
1001 B
Dart
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
|
import 'package:go_router/go_router.dart';
|
|
import 'package:pyramid/layout/shell_page.dart';
|
|
import 'package:pyramid/features/rooms/rooms_page.dart';
|
|
import 'package:pyramid/features/chat/chat_page.dart';
|
|
import 'package:pyramid/features/settings/settings_page.dart';
|
|
|
|
final routerProvider = Provider<GoRouter>((ref) {
|
|
return GoRouter(
|
|
initialLocation: '/rooms',
|
|
routes: [
|
|
ShellRoute(
|
|
builder: (context, state, child) => ShellPage(child: child),
|
|
routes: [
|
|
GoRoute(
|
|
path: '/rooms',
|
|
builder: (context, state) => const RoomsPage(),
|
|
),
|
|
GoRoute(
|
|
path: '/chat/:roomId',
|
|
builder: (context, state) =>
|
|
ChatPage(roomId: state.pathParameters['roomId']!),
|
|
),
|
|
GoRoute(
|
|
path: '/settings',
|
|
builder: (context, state) => const SettingsPage(),
|
|
),
|
|
],
|
|
),
|
|
],
|
|
);
|
|
});
|