Skip to content
pubscout

jaspr_router

0.9.0, released 4 months ago by schultek.dev

A simple routing component for Jaspr web applications adapted from go_router.

WASM-ready
$ flutter pub add jaspr_router
Source repository

What it does

Provides a declarative routing component for Jaspr web applications. It supports paths, lazy routes, code splitting, redirects, and browser history management.

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

Use it when

  • You are building a web application using the Jaspr framework and need page routing.
  • You want support for lazy loading routes and code splitting via deferred imports in Jaspr.
  • You are already familiar with the go_router package concepts.

Skip it when

  • You are building a standard Flutter application (use go_router instead).
  • You do not use the Jaspr framework.

Strengths

  • Familiar API adapted from go_router.
  • Supports lazy routes and automatic code splitting via deferred imports.
  • Handles server-side rendering redirects and base href configuration.

Weaknesses

  • Tied strictly to the Jaspr framework and cannot be used in normal Flutter apps.
  • Limited documentation outside of basic routing and lazy routes.

Setup

Kind
Pure Dart
Effort
Low
Code generation
No
Direct dependencies
2

Add jaspr_router to pubspec.yaml and define routes in your component build method.

class App extends StatelessComponent {
  @override
  Component build(BuildContext context) {
    return Router(routes: [
      Route(path: '/', builder: (context, state) => Home()),
      Route(path: '/about', builder: (context, state) => About()),
    ]);
  }
}

Alternatives

Packages that do the same job and could replace jaspr_router.

  • nuvigator

    Routing abstraction over Flutter navigator with nested navigation and deep links

  • auto_route

    A Flutter package for declarative, strongly‑typed navigation with code‑gen support.

  • auto_route_generator

    Code generator for the auto_route declarative routing solution.

  • flutter_slick

    An opinionated MVVM application framework with typed routing, auth, and form widgets.

Works with

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