StacNavigator, and when to use each option), see Navigation in Stac. For Flutter’s Navigator model, see the official documentation.
Property reference
You specify where to go with exactly one of:request, widgetJson, assetPath, or routeName. You specify how to go with navigationStyle. For pop-style navigation only navigationStyle (and optionally result) is used.
request
| Type | StacNetworkRequest |
| Required | No (optional; use one of request, widgetJson, assetPath, routeName for push-style) |
| JSON key | request |
navigationStyle = push, pushReplacement, or pushAndRemoveAll.
See Network Request Action for StacNetworkRequest fields (url, method, headers, body, etc.).
widgetJson
| Type | Map<String, dynamic> |
| Required | No (optional; use one of request, widgetJson, assetPath, routeName for push-style) |
| JSON key | widgetJson |
navigationStyle = push, pushReplacement, or pushAndRemoveAll.
assetPath
| Type | String |
| Required | No (optional; use one of request, widgetJson, assetPath, routeName for push-style) |
| JSON key | assetPath |
assets/) that contains the Stac widget JSON for the destination screen. The file is loaded and parsed when navigating. Good for bundled or offline screens.
Used with: navigationStyle = push, pushReplacement, or pushAndRemoveAll.
routeName
| Type | String |
| Required | No (optional; use one of request, widgetJson, assetPath, routeName for push-style) |
| JSON key | routeName |
- With Stac screens (push, pushReplacement, pushAndRemoveAll): name of the Stac screen (e.g. from your
/stacfolder or Stac Cloud). The Stac runtime resolves it to a widget (e.g. viaStac(routeName: routeName)). - With Flutter named routes (pushNamed, pushReplacementNamed, pushNamedAndRemoveAll): the route name registered in your app’s route table (e.g.
'/home','/settings').
navigationStyle. For Flutter routes use pushNamed, pushReplacementNamed, or pushNamedAndRemoveAll; for Stac screens use push, pushReplacement, or pushAndRemoveAll.
navigationStyle
| Type | NavigationStyle (enum) |
| Required | No (defaults to push when a destination is provided) |
| JSON key | navigationStyle |
push.
Values:
| Value | Description |
|---|---|
push | Pushes a new route on top of the current one. Use with request, widgetJson, assetPath, or routeName (Stac screen). |
pop | Pops the current route. Optional result is returned to the previous route. No destination. |
pushReplacement | Replaces the current route with a new one. Use with request, widgetJson, assetPath, or routeName. Optional result for the replaced route. |
pushAndRemoveAll | Pushes a new route and removes all routes below it. Use with request, widgetJson, assetPath, or routeName. |
popAll | Pops until the root route. No destination. |
pushNamed | Pushes a Flutter named route. Use with routeName (and optionally arguments). |
pushReplacementNamed | Replaces the current route with a Flutter named route. Use with routeName; optional result and arguments. |
pushNamedAndRemoveAll | Pushes a Flutter named route and removes all previous routes. Use with routeName and optionally arguments. |
result
| Type | Map<String, dynamic> |
| Required | No |
| JSON key | result |
pop: passed as the second argument toNavigator.pop(context, result).pushReplacement/pushReplacementNamed: passed as theresultto the replacement call so the previous route receives it when the new route is later popped.
arguments
| Type | Map<String, dynamic> |
| Required | No |
| JSON key | arguments |
arguments object passed to Navigator.pushNamed(..., arguments: arguments).
For examples (Dart and JSON), see Navigation in Stac.