go_router_aggregator 1.0.2
go_router_aggregator: ^1.0.2 copied to clipboard
Aggregates GoRouter's generated type-safe routes into one importable file, separating your route declarations from the router setup.
import 'package:flutter/material.dart';
import 'package:go_router/go_router.dart';
import 'package:go_router_aggregator_example/pages/home_page/home_page.dart';
import 'navigation/app_routes.g.dart';
void main() => runApp(const App());
class App extends StatelessWidget {
const App({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp.router(
routerConfig: GoRouter(
// a collection of all type-safe routes gathered across the project
// generated by the go_router_aggregator
routes: $aggregatedRoutes,
initialLocation: const HomePageRoute().location,
),
);
}
}