squid 0.1.1
squid: ^0.1.1 copied to clipboard
A simple, reliable and extensible declarative navigator for Flutter. The whole navigation is a plain list of routes you can rewrite at any moment.
Changelog #
All notable changes to this project will be documented in this file.
0.1.1 #
- Fixed: on Android with the predictive back gesture, the back button
no longer closes the application while the framework can handle the
press. The top level views report one state for the whole application:
a route to close, a visible nested view that can go back, a
PopScopeblocking the visible route, a previous tab of aNavigationTabsControlleror anonBackButtonPressedof the view. A nested view reports again when its route becomes current again, an inactive tab no longer speaks for the visible one, a view withinterceptBackButton: falseno longer claims the press, and removing the last view withdraws its claim. - Fixed: a
NavigationTabsControllerreports the back button when it is created around mounted views and when it is disposed, so no stale claim of a previous tab remains. - Fixed: a page built from the context of the view (the locale, the
theme, an inherited scope read in
NavigationRoute.page) is built again when that context changes instead of being taken from the cache. A guard reading the context, e.g. the size of the window, no longer rebuilds the pages. - Fixed: the default
keyof a route escapes%,&,=and?in the name and in the arguments and writes anullargument without a value, so different routes, e.g.{'q': 'a&b=c'}and{'q': 'a', 'b': 'c'},nulland'null', or the name'a?b'and the name'a'with{'b': null}, no longer produce the same key. - Fixed: observers are notified at the end of the frame, together with
the listeners, when a
ContextGuardchanges the stack during the build, so an observer callingsetStateno longer throws. The events keep their order when an observer changes the stack while they are delivered, and a change made by a listener at that moment no longer notifies the listeners once more on the next frame. - Fixed: an exception in one callback of an observer no longer swallows the remaining events of the same transition for that observer.
- Fixed: a guard returning an empty stack is reported to
FlutterErrorinstead of throwing an assertion, which dropped the changes queued after it in a debug build. - Fixed:
popandremoveKeycalled from a guard, an observer or a listener are postponed instead of being checked against the stack that is about to change, e.g.push(route)followed byremove(route).maybePopcalled from there decides against the stack it applies to and no longer reports a press as handled when nothing is popped. - Fixed: the result of a
popcancelled by a guard is dropped as soon as the guard cancels it, instead of waiting for the end of the queued changes. - Fixed: a guard can dispose the controller: the remaining guards do
not run, the observers are not notified, and a controller disposed during
its initial validation does not subscribe to
revalidate. Observers are also not notified when a listener disposes the controller. - Docs: a guard keeping a route closed by the user brings back a new
instance of it, use a
PopScopeto prevent the closing. - Docs: the name of a class route is minified in an obfuscated build,
routes compare by instance in a plain
List, overriddentagsmust keepkModalTag, callingpushForResultagain with the same key completes the previous waiter withnull,controller.stackwhile the guards run, changes made from a guard are queued, observer events may be delivered at the end of the frame, what the defaultkeyguarantees. - CI: a manual publication must start from the tag of the version and
be enabled on pub.dev, the pub cache depends on the pubspecs, the Flutter
version and the week and covers the example, a
.pubignorekeeps the development files out of the package.
0.1.0 #
- Initial release.
NavigationRoute— a route is an immutable value: anenumvalue when it has no parameters, asealed classwhen it has.NavigationController— the owner of the stack, usable without any widget, with guards, observers and revalidation built in.NavigationView— renders a controller with aNavigator, reports the routes closed by the user and handles the system back button.DialogRouteMixinandBottomSheetRouteMixin— dialogs and bottom sheets as ordinary entries of the navigation stack.NavigationGuardwith the built-inPriorityGuard,RootGuard,LimitGuardandGateGuard.ContextGuard— the rules that depend on the widget tree (the size of the window, the theme, an inherited scope) re-run by themselves whenever what they read changes.NavigationObserverandNavigationLogger.NavigationTabsController— several stacks side by side, cross tab navigation and automatic routing of the back button.- Docs: "Helpers of your application" — an extension type over
BuildContextwith application specific shortcuts andpopModals, which closes the declarative and the imperative popups at once. - Docs: "Deep links" — the initial link from the binding, the links received while running, and three ways to parse a link into a stack.
- Example:
context.nav,popModalsand deep links with tests. - Fixed: the system back button now reaches the deepest visible nested
NavigationViewfirst; previously the outer view closed the whole nested flow at once. - Fixed: a nested
NavigationViewcovered by a route or a dialog of the outer navigator no longer reacts to the back button, andinterceptBackButton: falsedisables the nested views as well. - Fixed:
Navigator.pop(context, result)completespushForResultwithresultinstead ofnull. - Fixed: a route closed by the user and kept by a guard is brought back on screen instead of leaving the navigator out of sync with the controller.
- Fixed: a
pushForResultrequested from a listener, a guard or an observer and then rejected by a guard completes withnullinstead of never. - Fixed: the result of a
popcancelled by a guard is no longer delivered by a later removal of the same route, and a postponedpopbinds its result to the route it actually removes. - Fixed: disposing the controller from an observer no longer applies the remaining queued changes to a disposed controller.
- Fixed: a
ContextGuardchanging the stack when the window size, the theme or a scope changes no longer throwssetState() or markNeedsBuild() called during buildin a widget above the view that listens to the controller (e.g. the shell of the tabs): the view renders the new stack in the same frame, the listeners are notified at the end of it. - Changed:
onBackButtonPressedis called only when the press reaches the view: not for an inactive tab and not when a nested view has handled it.NavigationScopeis no longer aconstconstructor. - Fixed:
GateGuardwith an open gate replaces an empty stack withopened(), the same way a closed gate falls back toclosed(). - Fixed: replacing the controller of a
NavigationViewruns its guards with the context of the view, so aContextGuardsees it immediately.