mirror of
https://github.com/lucavenir/go_router_riverpod.git
synced 2025-08-06 06:55:43 +08:00
40 lines
820 B
Dart
40 lines
820 B
Dart
import 'package:flutter/material.dart';
|
|
import 'package:go_router/go_router.dart';
|
|
|
|
import 'main.dart';
|
|
|
|
part 'routes.g.dart';
|
|
|
|
@TypedGoRoute<SplashRoute>(path: SplashRoute.path)
|
|
class SplashRoute extends GoRouteData {
|
|
const SplashRoute();
|
|
static const path = '/splash';
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return const SplashPage();
|
|
}
|
|
}
|
|
|
|
@TypedGoRoute<HomeRoute>(path: HomeRoute.path)
|
|
class HomeRoute extends GoRouteData {
|
|
const HomeRoute();
|
|
static const path = '/home';
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return const HomePage();
|
|
}
|
|
}
|
|
|
|
@TypedGoRoute<LoginRoute>(path: LoginRoute.path)
|
|
class LoginRoute extends GoRouteData {
|
|
const LoginRoute();
|
|
static const path = '/login';
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return const LoginPage();
|
|
}
|
|
}
|