go_router_aggregator 1.0.2 copy "go_router_aggregator: ^1.0.2" to clipboard
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.

example/lib/main.dart

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,
      ),
    );
  }
}
2
likes
150
points
68
downloads

Publisher

verified publishermitryp.com.ua

Weekly Downloads

Aggregates GoRouter's generated type-safe routes into one importable file, separating your route declarations from the router setup.

Repository (GitHub)
View/report issues

Topics

#codegen #go-router #navigation #build-runner

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

build, glob, path

More

Packages that depend on go_router_aggregator