rune_router 0.2.0
rune_router: ^0.2.0 copied to clipboard
go_router bridge for the rune package; registers GoRoute and GoRouter value builders plus a GoRouterApp widget wrapper on a RuneConfig so Rune source can declare routed navigation structure.
Changelog #
All notable changes to this package are documented here. Format follows Keep a Changelog; versioning follows Semantic Versioning.
0.2.0 - 2026-04-21 #
Added #
-
RouterBridge(router: myRouter)registers sixRouter.*prefixed imperatives onconfig.imperatives. When aGoRouteris supplied to the bridge constructor, Rune source can drive navigation directly without bouncing throughonEvent+ host Dart:final router = GoRouter(...); final config = RuneConfig.defaults() .withBridges([RouterBridge(router: router)]);Registered imperatives:
Router.go(location, extra?)- replace the current stack.Router.push(location, extra?)- push and return the result future.Router.pop([result])- pop the top route with an optional result.Router.pushReplacement(location, extra?)- replace the top route.Router.goNamed(name, pathParameters?, queryParameters?, extra?)- route-by-name navigation.
Router.pushNamed(name, pathParameters?, queryParameters?, extra?)- route-by-name push.
Source can invoke them as ordinary expressions:
ElevatedButton( onPressed: () => Router.go('/settings'), child: Text('Settings'), ) -
The plain
const RouterBridge()form (no router) remains unchanged: widget + value builders are registered, and source keeps navigating through host-sideonEventcallbacks.
Notes #
- Requires
rune ^1.19.0(unchanged; theImperativeRegistryitself landed in v1.16.0). - No existing source breaks: the
const RouterBridge()constructor still exists and still registers exactly what v0.1.0 did.
0.1.0 - 2026-04-20 #
Added #
- First release of
rune_router. Registers two value builders and one widget builder on aRuneConfigviaRouterBridge:GoRoute(path, builder, name?, routes?)value builder. Thebuilderclosure is 2-arity(BuildContext, GoRouterState) -> Widget; closures of the wrong arity raiseArgumentExceptionat registration time.GoRouter(routes, initialLocation?, debugLogDiagnostics?)value builder. Non-GoRoute entries inroutes:are filtered out silently so conditional[if (...)]constructs compose cleanly.GoRouterApp(router, title?, theme?, debugShowCheckedModeBanner?)widget. WrapsMaterialApp.router(routerConfig: router)so the source can install the router at the app root.
- Source-level imperatives (
context.go('/path'),context.push('/path')) remain out of scope for v0.1.0. Host apps navigate by keeping a reference to theGoRouterand calling.go(...)/.push(...)fromonEventcallbacks.