jaspr_router
0.9.0, released 4 months ago by schultek.dev
A simple routing component for Jaspr web applications adapted from go_router.
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
88Compare - auto_route
A Flutter package for declarative, strongly‑typed navigation with code‑gen support.
87Compare - auto_route_generator
Code generator for the auto_route declarative routing solution.
79Compare - flutter_slick
An opinionated MVVM application framework with typed routing, auth, and form widgets.
78Compare
Works with
Packages commonly used together with jaspr_router: ones it builds on, ones built on it, and its own family.
- webjaspr_router depends on itLightweight bindings for browser APIs via JS interop
- jasprjaspr_router depends on itA web framework for building websites in Dart with Flutter-like syntax and server-side rendering.
- jaspr_lintsSame familyA collection of lints and code assists for Jaspr projects.
- jaspr_riverpodSame familyRiverpod‑style state management for Jaspr with BuildContext extensions and server‑client sync.
- jaspr_contentBuilt on jaspr_routerJaspr plugin for building content-driven sites like documentation and blogs.
- naki_uiBuilt on jaspr_routerMaterial-inspired UI components and design utilities for building responsive web apps with Jaspr.