fiber_router 1.3.8
fiber_router: ^1.3.8 copied to clipboard
Typed navigation layer built on go_router declarative view, node, and shell routes with fade transitions and code-generated BuildContext extensions.
Changelog #
1.3.8 #
nameis now a required parameter onFiberRouteNode.view(),.deeplink(),.shell(), and.controller()(previously optional on all four) — every node must be explicitly named. Onview()/.deeplink()it only overrides the getter name generated byfiber_router_gen; it has no effect at runtime, since the actual route is still keyed by the widget type.- Fix:
FiberRouter.create()'sinitialLocationandredirectresolved a target widget's path by snake-casing its runtime type (e.g.DashboardView→/dashboard_view), ignoring any customnamegiven to thecontrollerthat widget belongs to (e.g.name: "dashboard"registers/dashboard, not/dashboard_view). This produced aGoException: no routes for location: /dashboard_viewwhenever a controller'snamediverged from its widget type. Controller widget types are now mapped to their actual registered route name and resolved correctly. - A
controller's real go_router route name/path is no longer just its ownname— it's now the full ancestor path (every shell/controller/group name from the root down to it, snake-cased and joined with_), e.g. a "detail" controller nested under "store" nested under "dashboard" registers as/dashboard_store_detail. This guarantees the registered route name is unique by construction, so two unrelated controllers can both be named"detail"without go_router throwingduplication fullpaths for name "detail"at startup. Views/deeplinks are unaffected — their route is still keyed by widget type, notname, which is already unique by construction. - Fix: a controller's own entry redirect (used when navigating to a controller with no params) computed its "first leaf" target via
_firstLeafName, which returned a nested controller's barenameinstead of its ancestor-qualified route name. This causedGoException: no routes for location: /store(or any nested controller) once controller routes became ancestor-qualified, since the redirect pointed at the old unqualified path._firstLeafNameis now ancestor-path-aware and returns the same qualified name that controller actually registers.
1.3.7 #
goShellNamedis now generic —Future<T?> goShellNamed<T>(String routeName, {bool replace = false})— returning the value passed tocontext.pop(result)whenreplaceisfalse. Returnsnullimmediately whenreplaceistrue(replace navigation cannot carry a result).
1.3.6 #
- Add
replaceparameter togoShell({bool replace = true}) —trueusespushReplacementNamed(default, preserves existing shell behavior),falseusespushNamedfor stackable shell navigation.
1.3.5 #
- Add
replaceparameter togoShellNamed(routeName, {bool replace = false})—replace: trueusespushReplacementNamed(no back navigation),replace: false(default) usespushNamed(stackable). Only affects controller navigation;goShellfor shell routes is unchanged.
1.3.4 #
- Fix controller shell transition:
ShellRoutefor controller nodes now usespageBuilder(returning_routeTransitionwith the node'stransitionandgesturePopEnabled) instead ofbuilder, so the transition is applied at the shell level rather than only on the inner redirect GoRoute that was never rendered. This fixes the visible animation when switching between controllers (e.g. store → brands) even whenRouteTransition.nonewas set.
1.3.3 #
- Add
transitionandgesturePopEnabledparameters toFiberRouteNode.controller()— controls the page transition and gesture behavior of the controller's entry route. Defaults toRouteTransition.noneandgesturePopEnabled: false.
1.3.2 #
- Fix import
1.3.1 #
- Make
builderoptional onFiberRouteNode.controller()— defaults to(context, child) => ControllerView(child: child)when omitted. - Add
BuildContext.goShellNamed(String routeName)— navigates by explicit route name rather than deriving it fromT.toString(), fixing controller navigation when an explicitnameoverride is provided.
1.3.0 #
- No runtime changes — version bump to stay in sync with
fiber_router_gen 1.4.0.
1.2.0 #
- Add
FiberRouteNode.controller<T>()— a hybrid route that acts as both a shell (wraps children with a persistent UI) and a navigable route registered at/<T snake_case>. Navigating to the controller automatically redirects to the first available leaf route. - Add optional
nameparameter toFiberRouteNode.shell()andFiberRouteNode.controller()— overrides the group class name derived from the builder widget type.
1.1.3 #
- Add
RouteTransition.none— usesNoTransitionPagefor an instant child swap with no animation duration. Useful for shell routes where transitions cause layout artefacts.
1.1.2 #
- Fix
goShell: replacegoNamedwithpushReplacementNamed(wrapped inRouter.neglect) so shell transitions go through the route'sCustomTransitionPageand apply the correct animation.goNamedbypassed the page-level transition, causing a blank frame between views.
1.1.1 #
- Remove
ShellRouterandShellRouterParamsfrom the library — they are now generated directly in the output file byfiber_router_gen, keeping the library free of generated-only artefacts.
1.1.0 #
- Add
ShellRouter<T>— shell navigation helper without areplaceparameter (navigation within a shell always swaps the child, never stacks). - Add
ShellRouterParams<T, P>— same asShellRouterbut with typed parameters. - Add
BuildContext.goShell<T, P>()— usesgoNamedso the shell child is replaced in-place rather than pushed onto the navigator stack.
1.0.0 #
- Initial release.
FiberRouter.create()— wrapsGoRouterwith a declarative node-based API.FiberRouteNode.view()— typed view route with optional fade transition.FiberRouteNode.node()— named group for organizing related routes.FiberRouteNode.shell()— shell route that keeps a persistent UI wrapper while inner routes change.FiberRouteNode.deeplink()— deeplink-capable route with query-parameter deserialization.BuildContext.go<T, P>()— type-safe navigation extension.GoRouterState.isOn<T>()— check if the current location matches a route type.NavigatorFadeTransition— fadePageRoutefor localNavigatorpush.@FiberRouterGen()— annotation to mark the router variable for code generation withfiber_router_gen.