Skip to content
pubscout

gg_router

3.4.0, released 5 days ago by inlavigo.com

Create nested routes, sync app state with browser URLs, and animate transitions.

WASM-readyUses material_ui
$ flutter pub add gg_router
Source repository

What it does

GgRouter helps you define nested routes, popover routes, and fallback routes in Flutter. It synchronizes application state with the browser URI, handles query parameters, and supports route-specific animations.

AI-written summary of version 3.3.1, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You want easy nested routing and browser URL synchronization.
  • You need page-based hierarchical navigation with animations.

Skip it when

  • You prefer standard mainstream routing packages like go_router or auto_route.
  • You need complex third-party navigation architectures not supported by GgRouter.

Strengths

  • Supports relative and absolute navigation.
  • Handles fallback routes (index, default, wildcard).
  • Saves and restores route state as JSON.

Weaknesses

  • Niche package with limited community compared to go_router.

Setup

Kind
Flutter widgets
Effort
Low
Code generation
No
Direct dependencies
3

Provide GgRouterDelegate and GgRouteInformationParser to MaterialApp.router.

class MyApp extends StatelessWidget {
  MyApp({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return MaterialApp.router(
      routerDelegate: GgRouterDelegate(
        child: Scaffold(
          body: GgRouterExample(),
        ),
      ),
      routeInformationParser: GgRouteInformationParser(),
    );
  }
}

Alternatives

Packages that do the same job and could replace gg_router.

  • go_router

    It is the officially endorsed declarative routing package for Flutter with a massive community.

  • auto_route

    It offers strongly-typed route generation and deep linking out of the box.

  • beamer

    It specializes in routing delegate management and synchronizing state with the browser history.

Works with

Packages commonly used together with gg_router: ones it builds on, ones built on it, and its own family.