StacNavigator class

Ergonomic navigation API for Stac.

Provides source-specific static factory methods for navigation actions, making it clear what type of destination you're navigating to.

{@tool snippet} Example usage:

// Pop current route
onPressed: StacNavigator.pop()

// Navigate to a Stac screen
onPressed: StacNavigator.pushStac('home_screen')

// Navigate to a Flutter route
onPressed: StacNavigator.pushFlutter('/settings')

// Navigate with inline JSON
onPressed: StacNavigator.pushJson({'type': 'text', 'data': 'Hello'})

// Navigate from asset file
onPressed: StacNavigator.pushAsset('assets/screens/home.json')

// Navigate from network
onPressed: StacNavigator.pushNetwork(StacNetworkRequest(url: '...'))

{@end-tool}

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

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

Static Methods

pop({Map<String, dynamic>? result}) StacNavigateAction
Pops the current route off the navigator stack.
popAll() StacNavigateAction
Pops all routes until the first route (root).
pushAndRemoveAllAsset(String assetPath) StacNavigateAction
Pushes a screen from an asset file and removes all previous routes.
pushAndRemoveAllFlutter(String routeName, {Map<String, dynamic>? arguments}) StacNavigateAction
Pushes a Flutter-defined named route and removes all previous routes.
pushAndRemoveAllJson(Map<String, dynamic> widgetJson) StacNavigateAction
Pushes a screen defined by inline widget JSON and removes all previous routes.
pushAndRemoveAllNetwork(StacNetworkRequest request) StacNavigateAction
Pushes a screen from a network request and removes all previous routes.
pushAndRemoveAllStac(String routeName) StacNavigateAction
Pushes a Stac screen and removes all previous routes.
pushAsset(String assetPath) StacNavigateAction
Pushes a screen loaded from a local asset file.
pushFlutter(String routeName, {Map<String, dynamic>? arguments}) StacNavigateAction
Pushes a Flutter-defined named route onto the navigator stack.
pushJson(Map<String, dynamic> widgetJson) StacNavigateAction
Pushes a screen defined by inline widget JSON.
pushNetwork(StacNetworkRequest request) StacNavigateAction
Pushes a screen loaded from a network request.
pushReplacementAsset(String assetPath, {Map<String, dynamic>? result}) StacNavigateAction
Replaces the current route with a screen loaded from a local asset file.
pushReplacementFlutter(String routeName, {Map<String, dynamic>? result, Map<String, dynamic>? arguments}) StacNavigateAction
Replaces the current route with a Flutter-defined named route.
pushReplacementJson(Map<String, dynamic> widgetJson, {Map<String, dynamic>? result}) StacNavigateAction
Replaces the current route with a screen defined by inline widget JSON.
pushReplacementNetwork(StacNetworkRequest request, {Map<String, dynamic>? result}) StacNavigateAction
Replaces the current route with a screen loaded from a network request.
pushReplacementStac(String routeName, {Map<String, dynamic>? result}) StacNavigateAction
Replaces the current route with a Stac screen.
pushStac(String routeName, {Map<String, dynamic>? arguments}) StacNavigateAction
Pushes a Stac screen onto the navigator stack.