ContextNavigationExtensions extension
Navigation helpers on BuildContext that preserve the current query parameters, extra, and fragment across calls.
- on
Properties
- canCollapseMobileLevel3 → bool
-
Available on BuildContext, provided by the ContextNavigationExtensions extension
no setter - canCollapseMobileLevel4 → bool
-
Available on BuildContext, provided by the ContextNavigationExtensions extension
no setter - canToggleLevel2 → bool
-
Available on BuildContext, provided by the ContextNavigationExtensions extension
True when level2 is part of the current layout and there's real content (level3/level4) next to it to collapse it against.no setter - currentExtra → Object?
-
Available on BuildContext, provided by the ContextNavigationExtensions extension
no setter - currentFragment → String
-
Available on BuildContext, provided by the ContextNavigationExtensions extension
no setter -
currentQueryParameters
→ Map<
String, String> -
Available on BuildContext, provided by the ContextNavigationExtensions extension
no setter - isLevel3MobileCollapsed → bool
-
Available on BuildContext, provided by the ContextNavigationExtensions extension
Uses watch, so the widget rebuilds when this changes.no setter - isLevel4MobileCollapsed → bool
-
Available on BuildContext, provided by the ContextNavigationExtensions extension
no setter - multilevelLayoutState → MultilevelLayoutRule
-
Available on BuildContext, provided by the ContextNavigationExtensions extension
Uses watch — call only from a widget below MultilevelNavigatorProvider.no setter - multilevelLayoutStateOnce → MultilevelLayoutRule
-
Available on BuildContext, provided by the ContextNavigationExtensions extension
One-shot read (no rebuild on change) — call only from a widget below MultilevelNavigatorProvider.no setter
Methods
-
closeAllModals(
{BuildContext? context}) → void -
Available on BuildContext, provided by the ContextNavigationExtensions extension
-
closeModal(
String modalId, {BuildContext? context}) → void -
Available on BuildContext, provided by the ContextNavigationExtensions extension
RemovesmodalIdfrom themodalquery parameter, dropping the parameter entirely if it was the last one open. -
closeModalAsync(
String modalId, {BuildContext? context}) → Future< void> -
Available on BuildContext, provided by the ContextNavigationExtensions extension
Async version of closeModal — await it before navigating further to guarantee the router has already updated. -
closeModalWithResult<
T> (String modalId, T? result, {BuildContext? context}) → void -
Available on BuildContext, provided by the ContextNavigationExtensions extension
ClosesmodalId, completing the Future from a matching openModalAsync. -
collapseLevel2(
) → void -
Available on BuildContext, provided by the ContextNavigationExtensions extension
-
collapseMobileLevel3(
) → void -
Available on BuildContext, provided by the ContextNavigationExtensions extension
Collapses level3 on mobile, revealing level2. With MobileLevelCollapseMode.preserve (the default) level3 stays mounted and its state survives; with MobileLevelCollapseMode.discard this is equivalent tocontext.pop(level: 3). -
collapseMobileLevel4(
) → void -
Available on BuildContext, provided by the ContextNavigationExtensions extension
See collapseMobileLevel3. -
expandLevel2(
) → void -
Available on BuildContext, provided by the ContextNavigationExtensions extension
-
expandMobileLevel3(
) → void -
Available on BuildContext, provided by the ContextNavigationExtensions extension
-
expandMobileLevel4(
) → void -
Available on BuildContext, provided by the ContextNavigationExtensions extension
-
go(
String location, {Map< String, String> queryParameters = const <String, String>{}, Object? extra}) → void -
Available on BuildContext, provided by the ContextNavigationExtensions extension
Accepts query parameters both inlocationand inqueryParameters; the latter take precedence on key collision. -
goNamed(
String name, {Map< String, String> pathParameters = const <String, String>{}, Map<String, String> queryParameters = const <String, String>{}, List<String> toggleModals = const <String>[], Object? extra}) → void -
Available on BuildContext, provided by the ContextNavigationExtensions extension
-
goNamedWithCloseModal(
String name, {required List< String> modalIds, Map<String, String> pathParameters = const <String, String>{}, Map<String, String> queryParameters = const <String, String>{}, Object? extra}) → void -
Available on BuildContext, provided by the ContextNavigationExtensions extension
ClosesmodalIdsand navigates tonameas a single atomic step. -
goNamedWithModal(
String name, {required String modalId, Map< String, String> pathParameters = const <String, String>{}, Object? extra}) → void -
Available on BuildContext, provided by the ContextNavigationExtensions extension
Addsmodalto the query parameters forname. -
goWithModal(
String location, {required String modalId, Object? extra}) → void -
Available on BuildContext, provided by the ContextNavigationExtensions extension
Addsmodalto the query parameters forlocation. -
isModalOpen(
String modalId) → bool -
Available on BuildContext, provided by the ContextNavigationExtensions extension
-
openModal(
String modalId, {BuildContext? context}) → void -
Available on BuildContext, provided by the ContextNavigationExtensions extension
OpensmodalIdon the current path. Multiple modals are comma-joined in themodalquery parameter. -
openModalAsync<
T> (String modalId, {BuildContext? context}) → Future< T?> -
Available on BuildContext, provided by the ContextNavigationExtensions extension
OpensmodalIdand returns a Future that completes with whatever closeModalWithResult passes when the modal closes (null otherwise). -
openModalAsyncWithArgs<
T> (String modalId, dynamic args, {BuildContext? context}) → Future< T?> -
Available on BuildContext, provided by the ContextNavigationExtensions extension
Like openModalWithArgs, but returns a Future with the close result. -
openModalInstance(
MultilevelModalBuilderAbstraction builder) → void -
Available on BuildContext, provided by the ContextNavigationExtensions extension
Opens a modal via a builder instance instead of the registered singleton (pattern A: constructor params). Thebuilderis stashed as a one-shot override and cleared automatically when the modal closes — it doesn't need to be pre-registered in MultilevelModalManager. -
openModalInstanceAsync<
T> (MultilevelModalBuilderAbstraction builder) → Future< T?> -
Available on BuildContext, provided by the ContextNavigationExtensions extension
Like openModalInstance, but returns a Future compatible with closeModalWithResult. -
openModalWithArgs(
String modalId, dynamic args, {BuildContext? context}) → void -
Available on BuildContext, provided by the ContextNavigationExtensions extension
OpensmodalIdwith arbitraryargs(pattern B), readable inside the builder via readModalArgs. Cleared automatically when the modal closes. -
pop(
{int? level}) → void -
Available on BuildContext, provided by the ContextNavigationExtensions extension
Closesleveland everything above it. Iflevelis omitted it's resolved from the current route name. -
pushNamed(
String name, {Map< String, String> pathParameters = const <String, String>{}, Map<String, String> queryParameters = const <String, String>{}, Object? extra}) → void -
Available on BuildContext, provided by the ContextNavigationExtensions extension
-
readModalArgs<
T> (String modalId) → T? -
Available on BuildContext, provided by the ContextNavigationExtensions extension
Reads args passed via openModalWithArgs, for use inside a modal builder. -
switchToFeature(
FeatureNavigationConfiguration feature) → void -
Available on BuildContext, provided by the ContextNavigationExtensions extension
Switches tofeature, saving the current URI so it can be restored when this feature is switched back to. -
toggleLevel2(
) → void -
Available on BuildContext, provided by the ContextNavigationExtensions extension
-
toggleMobileLevel3(
) → void -
Available on BuildContext, provided by the ContextNavigationExtensions extension
-
toggleMobileLevel4(
) → void -
Available on BuildContext, provided by the ContextNavigationExtensions extension
-
toggleModals(
List< String> modalIds, {BuildContext? context}) → void -
Available on BuildContext, provided by the ContextNavigationExtensions extension
Toggles each id inmodalIds: closes it if open, opens it otherwise.