| Name | Modified | Size | Downloads / Week |
|---|---|---|---|
| Parent folder | |||
| README.md | 2026-08-21 | 4.6 kB | |
| v7.28.0 source code.tar.gz | 2026-08-21 | 615.0 kB | |
| v7.28.0 source code.zip | 2026-08-21 | 777.8 kB | |
| Totals: 3 Items | 1.4 MB | 1 | |
Added
nameandpathconstructor parameters onNavigationHub-NavigationHub(this.pages, {super.name, super.path})forwards both toNyPage, so a hub can declare the state name it is addressed by. This lets a hub and theNavigationHubStateActionsthat drive it agree on one name, e.g.MyHub({super.key}) : super(child: () => _MyHubState(), stateName: path.stateName());alongsidestatic NavigationHubStateActions stateActions = NavigationHubStateActions(path.stateName());NyStatefulWidget.declaredStateName- Holds thestateNamepassed to the constructor, when one was given. The existingstatemember becomes a computed getter that returnsdeclaredStateNamewhen set and otherwise derives the name from the widget's own class, so the name a widget listens on is always available even where nostateNamewas declared- A reported route whose builder names no page - A route built from a function declared to return
Widget- a tear-off of a named function, or a variable typed as theRouteViewsignature - carries that declared type at runtime instead of the page class, so the page behind it cannot be read back from the route and the derived state name reaches nothing.NyLogger.errornow names such a route once, with both ways to address it: build the route from a closure that returns the page,("/my-page", (_) => MyPage()), or give the page a name of its own viasuper(child: () => _MyPageState(), stateName: "/my-page"). Previously the state update was dropped by the event bus in silence - A reported state name that reaches no
NavigationHub-NavigationHubStateActions.nextPage()andpreviousPage()now report once, viaNyLogger.error, when no hub is listening on the name they address, detected from the absence of the${state}_current_tabkey a hub writes as the first thing itsinitdoes. A journey that could not advance previously did so without a trace
Changed
- State names are built from the page's widget class on both ends of a state update - Every name now resolves through a single helper (
lib/helpers/src/state_name.dart), so the listening end (NyPage,NyState) and the sending end (RouteViewExt.stateName,updateStatewith aRouteView,stateAction) build the same string from the same class. The widget class is the anchor because it is the only class both ends can see - a sender holds aRouteView, which knows the widget it builds and nothing about the state behind it. For the naming convention Metro scaffolds (MyPagewith_MyPageState) the resulting name is unchanged; a state class named outside that convention now resolves toClosure: () => _${WidgetClass}Stateon both ends rather than to its own class name NyStatepoints its controller at the page it is used from -_controller.stateis now assigned the resolvedstateNameon everyinitState, rather than only when it still held the initial"/". A controller registered as a singleton is shared by every page that asks for it, socontroller.refreshPage()and the other controller state helpers now address the page they are called from instead of the name an earlier page left behind
Fixed
- State updates not arriving in obfuscated builds - The listening end read the state class (
child.runtimeType) while senders read the widget class from the route builder's return type.flutter build --obfuscaterenames a widget and its state to two unrelated symbols, so the two ends produced names that no longer matched and every update sent to the page was dropped. Both ends now read the widget class, which a compiler that renames classes renames for both at once.updateState's history lookup contributed the same failure throughelement.event.runtimeType.toString() != 'UpdateState', a comparison against a class name that obfuscation rewrites; it now testsevent is! UpdateStateand reads the event'sdatafield rather thanprops[1] NyPageadopting another page's state data on init - Restoring from the event bus history took the lastUpdateStateentry regardless of which state it was sent to, so a page could open holding a payload addressed to a different page. The lookup now matchesstateNamebefore taking the most recent entryJourneyState.isLastStepreporting the last step where a journey has no steps - WithtotalStepsat0the comparison read0 >= -1and answered true, so a step whose hub data had not been read yet was treated as the end of the journey. The getter now requirestotalSteps > 0