dash_router 1.1.1
dash_router: ^1.1.1 copied to clipboard
A powerful, type-safe Flutter routing library with zero mental overhead. Features code generation, guards, middleware, and seamless navigation.
Changelog #
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
1.1.1 - 2025-12-21 #
Changed #
- Enhanced Code Documentation: Improved documentation accuracy and clarity across the codebase
- Fixed Documentation: Corrected inaccurate descriptions about navigation history management
1.1.0 - 2025-12-20 #
Added #
- Navigator 2.0 Support: Full declarative navigation support with
MaterialApp.router- Added
DashRouterWidgetfor simplified router setup - Added
DashRouterScopefor accessing router from widget tree - Added
routerConfigextension for convenientMaterialApp.routerintegration - Enhanced
_DashRouterDelegatewith proper URL synchronization - Enhanced
_DashRouteInformationParserwith query parameter support - Added
_NavigatorObserverAdapterfor tracking route changes
- Added
- Deep Linking: Complete URL handling for web and mobile platforms
- Browser history integration on web
- System back button handling via
PopNavigatorRouterDelegateMixin BackButtonDispatchersupport for Android hardware back button
- New exports in
dash_router.dart:src/navigation/router_widget.dart
Changed #
- Improved documentation with Navigator 1.0 and 2.0 usage examples
- Updated README with deep linking and shell routes documentation
- Removed deprecated
onPopPagecallback in favor of modern Navigator API
Documentation #
- Added comprehensive Navigator 2.0 setup guide
- Added shell routes usage examples
- Updated installation version to ^1.1.0
1.0.1 - 2025-12-14 #
Fixed #
- Fixed documentation errors with incorrect API references
- Corrected parameter access examples in README (use
route.body.argumentsinstead of direct cast) - Updated route guard and middleware documentation to reflect instance-based usage
- Removed references to non-existent
@PathParam,@QueryParam,@BodyParamannotations - Fixed
DashRouteScope.of()to throwStateErrorinstead of using assert for better error handling
Changed #
- Extracted shared
matchGlobPatternutility toRouteUtilsclass for code deduplication - Improved dispose method to properly clean up internal state
- Unified route annotation API - all route types (shell, redirect, dialog, initial) now use
@DashRoutewith appropriate properties
Documentation #
- Added comprehensive examples for shell routes with
shell: true - Added examples for fullscreen dialog routes with
fullscreenDialog: true - Added examples for redirect routes with
redirectTo - Updated example project with
EditProfilePagedemonstrating fullscreen dialog - Improved README with all unified DashRoute usage patterns
1.0.0 - 2025-12-13 #
Added #
- Initial stable release of dash_router
- Core
DashRouterclass for route management and navigation RouteEntryclass for defining route configurationsRedirectEntryclass for route redirectsDashRouterOptionsfor router configuration- Type-safe parameter access via
RouteDataandTypedParamsResolver RouteInfoCachefor O(1) parameter access using InheritedWidgetDashTypedRoutebase class for generated typed routes with$-prefixed API:$pattern- Route pattern with parameter placeholders$name- Route name for named navigation$path- Concrete path with interpolated values$query- Query parameters map$body- Body arguments (supports Record types)$transition- Optional custom transition per-navigation
- Navigation extensions on
BuildContext:- Typed Route Navigation (recommended):
push(DashTypedRoute)- Push typed routereplace(DashTypedRoute)- Replace with typed routepopAndPush(DashTypedRoute)- Pop and push typed routepushAndRemoveUntil(DashTypedRoute, predicate)- Push and removepushAndRemoveAll(DashTypedRoute)- Clear stack and push
- String Path Navigation:
pushNamed(path, {query, body, transition})- Push by pathreplaceNamed(path, ...)- Replace by pathpopAndPushNamed(path, ...)- Pop and push by pathpushNamedAndRemoveUntil(path, predicate, ...)- Push and removepushNamedAndRemoveAll(path, ...)- Clear stack and push
- Pop Operations:
pop([result])- Pop current routepopUntil(predicate)- Pop until predicatepopUntilNamed(path)- Pop until reaching pathpopToRoot()- Pop to root routemaybePop([result])- Respects route guardsback([result])- Alias for pop
- Navigation State:
canGoBack- Check if can go backpreviousPath- Get previous route path
- Typed Route Navigation (recommended):
- Built-in transitions:
DashFadeTransition- Fade animationDashSlideTransition- Slide from any directionDashScaleTransition- Scale animationDashRotationTransition- Rotation animationDashScaleFadeTransition- Combined scale and fadeDashSlideFadeTransition- Combined slide and fadePlatformTransition- Platform-adaptive transitionMaterialTransition- Material Design transitionCupertinoTransition- iOS-style transitionNoTransition- Instant transition without animation
CustomAnimatedTransitionfor runtime custom transitions- Route guards system with
DashGuardbase class:canActivate()- Check if navigation is allowedonActivated()- Called after successful navigationonDenied()- Called when navigation is deniedroutesandexcludeRoutesfor glob pattern filteringpriorityfor execution order control
- Guard results:
GuardAllow,GuardDeny,GuardRedirect - Utility guards:
FunctionalGuard,ConditionalGuard,AsyncConditionalGuard - Middleware system with
DashMiddlewarebase class:handle()- Process navigation requestafterNavigation()- Called after successful navigationonAborted()- Called when navigation is aborted
- Middleware results:
MiddlewareContinue,MiddlewareAbort,MiddlewareRedirect - Utility middleware:
FunctionalMiddleware,LoggingMiddleware,DelayMiddleware - Navigation history tracking with
NavigationHistory - Shell routes support for nested navigation with isolated animations
- Nested navigator support via
NestedNavigatorandStatefulShellScope - Automatic nested navigation detection in navigation methods
- Full cross-platform support (iOS, Android, Web, macOS, Windows, Linux)
API Design #
- Typed Routes: Use
$-prefixed properties to avoid conflicts with user parameters - Naming Convention: Path-based class names (e.g.,
/app/user/:id→AppUser$IdRoute) - Navigation Separation: Clear distinction between typed route and string path navigation
- Body Parameters: Support for complex types via Record tuples or Map