flutter_unrouter 0.2.0
flutter_unrouter: ^0.2.0 copied to clipboard
Declarative nested router for Flutter with guards and Router API integration.
Changelog #
0.2.0 #
Migration guide: See Migration note below.
Highlights #
Flutter Unrouter 0.2.0 rebuilds the package on top of unrouter_core and
aligns the Flutter API with the new shared route-tree model. This release
replaces the old typed route-data adapter surface with createRouter,
Inlet, Outlet, and createRouterConfig, refreshes the Flutter example app,
and expands test coverage around links, route scopes, data loaders, and
history-driven router updates.
Breaking Changes #
- Routers are now created with
createRouter(routes: [...])andInletdeclarations instead ofUnrouter<T>(routes: ...). MaterialApp.routernow usescreateRouterConfig(router)instead of passing the router directly asrouterConfig.- The old
route(),dataRoute(),branch(), andshell()Flutter adapter helpers are gone. - The adapter no longer exposes the old generic
Unrouter<T>surface from0.1.x.
What's New #
Flutter Router integration
- Added
createRouterConfig(router)and the rebuilt route-information provider, parser, delegate, and back-button integration for Flutter apps.
Nested routing UI
- Added
Outlet-driven nested rendering for parent and child route layouts. - Added
RouteScopeProviderplus route hooks such asuseRouteParams,useQuery,useLocation,useRouteState<T>, anduseFromLocation. - Added
Linkfor declarative push and replace navigation inside widget trees.
Data loading, examples, and tests
- Added
defineDataLoaderfor context-aware async loading in Flutter widgets. - Added a refreshed workspace Flutter example with quick-start and advanced flows.
- Expanded test coverage for router delegation, route scopes, links, outlet rendering, history pop handling, and data loaders.
Migration note #
-
Replace
Unrouter<T>(routes: ...)withcreateRouter(routes: [...]). Flutter routes are now declared withInlet, notroute(),dataRoute(),branch(), orshell(). -
Replace typed route-data parsing with direct path trees.
Before:
final router = Unrouter<AppRoute>( routes: <RouteRecord<AppRoute>>[ route<HomeRoute>( path: '/', parse: (_) => const HomeRoute(), builder: (_, __) => const HomePage(), ), ], );After:
final router = createRouter( routes: [ Inlet(path: '/', view: HomePage.new), ], ); -
Replace
MaterialApp.router(routerConfig: router)withMaterialApp.router(routerConfig: createRouterConfig(router)). -
Replace shell layouts with nested
Inlet(children: [...])plusOutlet()inside the parent view. -
Replace old scope access with
useRouter,useRouteParams,useQuery,useLocation,useRouteState<T>, anduseFromLocation.
Full Changelog #
0.1.0 #
Migration guide: Not required.
Highlights #
Flutter Unrouter 0.1.0 introduced the first standalone Flutter adapter for Unrouter, pairing the original typed route-data model with Flutter Router integration and a full example app.
Breaking Changes #
- None.
What's New #
Initial adapter package
- Added the initial Flutter adapter package for
unrouter. - Kept the adapter runtime lean by inheriting the original core
Unroutercontroller directly.
Examples and tests
- Added a complete Flutter example covering shell navigation, guards, redirects, loader routes, and typed push/pop flows.
- Added functional runtime and widget tests for route-information sync, scope helpers, delegate fallbacks, and shell branch behavior.
Migration note #
- No migration is required for the initial release.