Skip to main content
The Navigate action performs navigation in a Flutter app from JSON or Dart. For an overview of how navigation works in Stac (destinations, 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

Network request used to load the destination screen JSON. The response body is parsed as Stac widget JSON and shown as the new route. Use for server-driven screens loaded at navigation time. Used with: navigationStyle = push, pushReplacement, or pushAndRemoveAll. See Network Request Action for StacNetworkRequest fields (url, method, headers, body, etc.).

widgetJson

Inline Stac widget tree (JSON map) used as the destination screen. No network or asset load; the screen is defined entirely in the action. Good for one-off or dynamic screens. Used with: navigationStyle = push, pushReplacement, or pushAndRemoveAll.

assetPath

Path to a local asset file (e.g. in 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

  • With Stac screens (push, pushReplacement, pushAndRemoveAll): name of the Stac screen (e.g. from your /stac folder or Stac Cloud). The Stac runtime resolves it to a widget (e.g. via Stac(routeName: routeName)).
  • With Flutter named routes (pushNamed, pushReplacementNamed, pushNamedAndRemoveAll): the route name registered in your app’s route table (e.g. '/home', '/settings').
Used with: any push-style navigationStyle. For Flutter routes use pushNamed, pushReplacementNamed, or pushNamedAndRemoveAll; for Stac screens use push, pushReplacement, or pushAndRemoveAll.
Controls how the navigation is performed: push, pop, replace, or clear stack. When omitted and a destination is given, behavior is push. Values:

result

Data returned to the previous route when the current route is removed.
  • pop: passed as the second argument to Navigator.pop(context, result).
  • pushReplacement / pushReplacementNamed: passed as the result to the replacement call so the previous route receives it when the new route is later popped.

arguments

Arguments passed to the new route. For Stac screens (push/pushReplacement/pushAndRemoveAll + routeName), the Stac runtime can use these when building the screen. For Flutter named routes (pushNamed, pushReplacementNamed, pushNamedAndRemoveAll), this is the arguments object passed to Navigator.pushNamed(..., arguments: arguments). For examples (Dart and JSON), see Navigation in Stac.