NavigationLogic class

A class representing the navigation logic for a Flutter application, using GoRouter.

Manages the routing and screen transitions with integrated feature access control. Handles loading states, authentication, and permission-based redirects.

Inheritance

Constructors

Creates a new NavigationLogic instance with GoRouter.

Properties

alertController → AlertController?
final
authState → Stream?
final
canGoBack → bool
Check if you can navigate back in history
no setter
canGoUp → bool
Check if you can navigate up the route hierarchy (to a parent)
no setter
currentPath → String
Get the current path provided by goRouter instance
no setter
defaultLoading ↔ Widget Function()?
getter/setter pair
defaultLoadingOverlay ↔ Widget Function()?
Drawn over content that is still on screen: the RouteSnapshot once the destination claims it, and the view during loading(style: overlay). Null uses DefaultLoadingOverlay, a dimmed scrim with a centred spinner. Keep a replacement translucent so the content underneath shows through.
getter/setter pair
defaultMenuItems → List<NavigationItem>?
(Optional) default menu items
final
defaultTabItems → List<NavigationItem>?
(Optional) default tab items
final
featureAccessController ↔ FeatureAccessController?
getter/setter pair
filteredMenuItems → List<NavigationItem>?
Filter the defaultMenuItems with featureAccessController available permissions
no setter
filteredTabItems → List<NavigationItem>?
Filter the defaultTabItems with featureAccessController available permissions
no setter
goRouter ↔ GoRouter
getter/setter pair
hashCode → int
The hash code for this object.
no setterinherited
hasListeners → bool
Whether any listeners are currently registered.
no setterinherited
initialiseRoute → void Function(BuildContext context)?
Global callback that runs when any route is entered
final
isLoading ↔ bool
Set the loading state of NavigationLogic
getter/setter pair
parentDepth → int
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
smartBackOrder → SmartBackOrder
final
useSmartBack → bool
final
useSnapshotLoading → bool
Whether route changes made through this class keep a screenshot of the current page on screen while the destination's view model initialises.
final

Methods

addListener(VoidCallback listener) → void
Register a closure to be called when the object changes.
inherited
addRouteChangeListener(RouteChangeCallback callback) → void
Register a callback to be called when the route changes
adoptRouteSnapshot() → RouteSnapshot?
Hands the snapshot captured for the route change in progress to the first SlickPageHost that mounts, or null when there is none.
dispose() → void
Discards any resources used by the object.
override
goBack({bool? smart}) → void
goReplace(SlickRoute path, {Object? extra}) → void
Navigate to a specified route path, replacing the current route
goTo(SlickRoute path, {Object? extra}) → void
Navigate to a specified route path, adding it to the stack
goUp() → void
Navigate to the parent path, if there is any
isReadOnly() → Future<bool>
Determine whether the current route has read-only access
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
notifyListeners() → void
Call all the registered listeners.
inherited
registerPageBoundary(GlobalKey<State<StatefulWidget>> key) → void
Called by SlickPageHost when a page mounts. The most recently registered boundary is the page captured on the next route change.
removeListener(VoidCallback listener) → void
Remove a previously registered closure from the list of closures that are notified when the object changes.
inherited
removeRouteChangeListener(RouteChangeCallback callback) → void
Unregister a route change callback
toString() → String
A string representation of this object.
inherited
unregisterPageBoundary(GlobalKey<State<StatefulWidget>> key) → void
Called by SlickPageHost when a page unmounts.

Operators

operator ==(Object other) → bool
The equality operator.
inherited