Skip to main content

Navigate Action

The Stac Navigate Action allows you to perform navigation actions in a Flutter application using JSON. To know more about navigation in Flutter, refer to the official documentation.

Properties​

PropertyTypeDescription
requestStacNetworkRequest?The network request to perform before navigation.
widgetJsonMap<String, dynamic>?The JSON representation of the widget to navigate to.
assetPathString?The asset path of the widget to navigate to.
routeNameString?The name of the route to navigate to.
navigationStyleNavigationStyle?The style of navigation (e.g., push, pop, pushReplacement, etc.).
resultMap<String, dynamic>?The result to return when popping the route.
argumentsMap<String, dynamic>?The arguments to pass to the route.

The NavigationStyle enum defines the different styles of navigation that can be used in the Stac Navigate Action.

ValueDescription
pushPushes a new route onto the navigator stack.
popPops the current route off the navigator stack.
pushReplacementReplaces the current route with a new route.
pushAndRemoveAllPushes a new route and removes all the previous routes.
popAllPops all the routes off the navigator stack.
pushNamedPushes a named route onto the navigator stack.
pushNamedAndRemoveAllPushes a named route and removes all the previous routes.
pushReplacementNamedReplaces the current route with a named route.

Example JSON​

{
"actionType": "navigate",
"request": {
"url": "https://example.com/api",
"method": "get"
},
"navigationStyle": "push"
}
{
"actionType": "navigate",
"widgetJson": {
"type": "scaffold",
"appBar": {
"type": "appBar",
"title": {
"type": "text",
"data": "My App"
}
},
"body": {
"type": "center",
"child": {
"type": "text",
"data": "Hello, World!"
}
}
},
"navigationStyle": "push"
}
{
"actionType": "navigate",
"assetPath": "assets/widgets/my_widget.json",
"navigationStyle": "push"
}
{
"actionType": "navigate",
"routeName": "/home",
"navigationStyle": "pushNamed"
}