qlevar_router
2.0.0, released 7 weeks ago by qlevar.de
Router for Flutter with nested routes and navigation without context
What it does
Helps manage project routing, navigation, deep linking, route parameters, and nested routes using Navigator 2.0. Allows navigating without context from anywhere in the app.
AI-written summary of version 2.0.0, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need complex nested routing or nested navigators.
- You want to navigate between pages without needing a BuildContext.
- You need robust middleware handling for route entry, exit, matching, and redirection.
Skip it when
- You prefer sticking purely to the standard go_router setup without extra router-specific paradigms.
- You are using a Flutter version older than 3.24 and cannot upgrade or use version 1.12.4.
Strengths
- Allows navigation without context from anywhere in the code.
- Supports nested navigators and nested routes easily.
- Advanced parameter management with path, query, and hidden params.
- Comprehensive middleware system with priority and lifecycle hooks.
Weaknesses
- Requires updating to newer Flutter versions (3.24+) for version 2.0.0.
- Routing concepts and API differ from standard go_router or auto_route, requiring a learning curve.
Setup
- Kind
- Flutter widgets
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 0
Requires setting up MaterialApp.router with QRouteInformationParser and QRouterDelegate.
class AppRoutes {
final routes = [
QRoute(path: '/', builder: () => HomePage()),
QRoute(path: '/user/:userId', builder: () => UserPage()),
];
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) => MaterialApp.router(
routeInformationParser: QRouteInformationParser(),
routerDelegate: QRouterDelegate(AppRoutes().routes));
}Alternatives
Packages that do the same job and could replace qlevar_router.
- go_router
Official declarative routing package supported by the Flutter team with widespread adoption.
98Compare - auto_route
Code-generation based routing approach for strong typing and straightforward parameter passing.
87Compare - beamer
URL-centric navigation delegate using Router API for dynamic nested routing.
50Compare