Skip to content

Commit 1fec629

Browse files
committed
docs: Add new docs in /docs
1 parent 36c3b60 commit 1fec629

File tree

107 files changed

+7628
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

107 files changed

+7628
-0
lines changed

docs/actions/delay_action.mdx

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
---
2+
title: "Delay Action"
3+
description: "Documentation for Delay Action"
4+
---
5+
6+
# Delay Action
7+
8+
The `StacDelayAction` allows you to do nothing for a specified duration.
9+
10+
## Delay Action Properties
11+
12+
| Property | Type | Description |
13+
| --- |-------------------|---------------------------------------------------|
14+
| milliseconds | `int` | The amount of time (in milliseconds) we want to wait for |
15+
16+
## Delay Action JSON
17+
18+
```json
19+
{
20+
"actionType": "delay",
21+
"milliseconds": 1000
22+
},
23+
24+
```

docs/actions/dialog.mdx

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
---
2+
title: "Dialog Action"
3+
description: "Documentation for Dialog Action"
4+
---
5+
6+
# Dialog Action
7+
8+
The `StacDialogAction` class is used to display a dialog in Stac applications.
9+
10+
## Properties
11+
12+
| Property | Type | Description |
13+
|------------------------|-------------------------------|-----------------------------------------------------------------------------|
14+
| widget | `Map<String, dynamic>?` | The widget to display inside the dialog. |
15+
| request | `StacNetworkRequest?` | The network request to perform before displaying the dialog. |
16+
| assetPath | `String?` | The asset path of the widget to display inside the dialog. |
17+
| barrierDismissible | `bool` | Whether the dialog is dismissible by tapping outside. Defaults to `true`. |
18+
| barrierColor | `String?` | The color of the modal barrier. |
19+
| barrierLabel | `String?` | The semantic label for the modal barrier. |
20+
| useSafeArea | `bool` | Whether to use the safe area. Defaults to `true`. |
21+
| traversalEdgeBehavior | `TraversalEdgeBehavior?` | The traversal edge behavior of the dialog. |
22+
23+
## Example JSON
24+
25+
### Dialog with a Widget JSON
26+
27+
```json
28+
{
29+
"actionType": "showDialog",
30+
"widget": {
31+
"type": "text",
32+
"data": "Hello, World!"
33+
}
34+
}
35+
```
36+
37+
### Dialog with a Request JSON
38+
39+
```json
40+
{
41+
"actionType": "showDialog",
42+
"request": {
43+
"url": "https://example.com/api",
44+
"method": "get"
45+
}
46+
}
47+
```
48+
49+
### Dialog with an Asset JSON
50+
51+
```json
52+
{
53+
"actionType": "showDialog",
54+
"assetPath": "assets/dialog.json"
55+
}
56+
```

docs/actions/form_validate.mdx

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
---
2+
title: "Form Validate Action"
3+
description: "Documentation for Form Validate Action"
4+
---
5+
6+
# Form Validate Action
7+
8+
The `StacFormValidateAction` class is used to validate a form in Stac applications.
9+
10+
## Properties
11+
12+
| Property | Type | Description |
13+
|-------------|-------------------------|-----------------------------------------------------------------------------|
14+
| isValid | `Map<String, dynamic>` | The action to perform if the form is valid. |
15+
| isNotValid | `Map<String, dynamic>` | The action to perform if the form is not valid. |
16+
17+
## Example JSON
18+
19+
### Form Validate Action JSON
20+
21+
```json
22+
{
23+
"actionType": "validateForm",
24+
"isValid": {
25+
"actionType": "showDialog",
26+
"widget": {
27+
"type": "text",
28+
"data": "Form is valid!"
29+
}
30+
},
31+
"isNotValid": {
32+
"actionType": "showDialog",
33+
"widget": {
34+
"type": "text",
35+
"data": "Form is not valid!"
36+
}
37+
}
38+
}
39+
```

docs/actions/get_form_value.mdx

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
---
2+
title: "Get Form Value Action"
3+
description: "Documentation for Get Form Value Action"
4+
---
5+
6+
# Get Form Value Action
7+
8+
The `StacGetFormValueAction` class is used to retrieve a form value in Stac applications.
9+
10+
## Properties
11+
12+
| Property | Type | Description |
13+
|-----------|----------|------------------------------------|
14+
| id | `String` | The ID of the form field to get. |
15+
16+
## Example JSON
17+
18+
### Get Form Value Action JSON
19+
20+
```json
21+
{
22+
"actionType": "getFormValue",
23+
"id": "username"
24+
}
25+
```
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
---
2+
title: "Modal Bottom Sheet Action"
3+
description: "Documentation for Modal Bottom Sheet Action"
4+
---
5+
6+
# Modal Bottom Sheet Action
7+
8+
The `StacModalBottomSheetAction` class is used to display a modal bottom sheet in Stac applications.
9+
10+
## Properties
11+
12+
| Property | Type | Description |
13+
|---------------------|-------------------------------|-----------------------------------------------------------------------------|
14+
| widget | `Map<String, dynamic>?` | The widget to display inside the modal bottom sheet. |
15+
| request | `StacNetworkRequest?` | The network request to perform before displaying the modal bottom sheet. |
16+
| assetPath | `String?` | The asset path of the widget to display inside the modal bottom sheet. |
17+
| backgroundColor | `String?` | The background color of the modal bottom sheet. |
18+
| barrierLabel | `String?` | The semantic label for the modal barrier. |
19+
| elevation | `double?` | The elevation of the modal bottom sheet. |
20+
| shape | `StacBorder?` | The shape of the modal bottom sheet. |
21+
| constraints | `StacBoxConstraints?` | The constraints for the modal bottom sheet. |
22+
| barrierColor | `String?` | The color of the modal barrier. |
23+
| isScrollControlled | `bool` | Whether the modal bottom sheet is scroll controlled. Defaults to `false`. |
24+
| useRootNavigator | `bool` | Whether to use the root navigator. Defaults to `false`. |
25+
| isDismissible | `bool` | Whether the modal bottom sheet is dismissible. Defaults to `true`. |
26+
| enableDrag | `bool` | Whether the modal bottom sheet can be dragged. Defaults to `true`. |
27+
| showDragHandle | `bool?` | Whether to show a drag handle on the modal bottom sheet. |
28+
| useSafeArea | `bool` | Whether to use the safe area. Defaults to `false`. |
29+
30+
## Example JSON
31+
32+
### Modal Bottom Sheet with a Widget JSON
33+
34+
```json
35+
{
36+
"actionType": "showModalBottomSheet",
37+
"widget": {
38+
"type": "container",
39+
"height": 200,
40+
"color": "amber",
41+
"child": {
42+
"type": "center",
43+
"child": {
44+
"type": "column",
45+
"mainAxisAlignment": "center",
46+
"mainAxisSize": "min",
47+
"children": [
48+
{
49+
"type": "text",
50+
"data": "Modal BottomSheet"
51+
},
52+
{
53+
"type": "elevatedButton",
54+
"child": {
55+
"type": "text",
56+
"data": "Close BottomSheet"
57+
},
58+
"onPressed": {
59+
"actionType": "pop"
60+
}
61+
}
62+
]
63+
}
64+
}
65+
}
66+
}
67+
```
68+
69+
### Modal Bottom Sheet with an Asset Path
70+
71+
```json
72+
{
73+
"actionType": "showModalBottomSheet",
74+
"assetPath": "assets/widgets/modal_bottom_sheet.json"
75+
}
76+
```
77+
78+
### Modal Bottom Sheet with a Network Request
79+
80+
```json
81+
{
82+
"actionType": "showModalBottomSheet",
83+
"request": {
84+
"url": "https://example.com/api",
85+
"method": "get"
86+
}
87+
}
88+
```

docs/actions/multi_action.mdx

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
---
2+
title: "Multi Action"
3+
description: "Documentation for Multi Action"
4+
---
5+
6+
# Multi Action
7+
8+
The `StacMultiAction` allows you to execute multiple actions with ease.
9+
10+
## Multi Action Properties
11+
12+
| Property | Type | Description |
13+
| --- |-------------------|---------------------------------------------------|
14+
| actions | `List<Map<String, dynamic>?>?` | The list of actions to be performed |
15+
| sync | `bool` | Whether to execute the actions in syncronous or parallel. Defaults to `false`. |
16+
17+
## Multi Action JSON
18+
19+
This example will allow you to show a snackbar through `StacShowSnackBarAction`, execute a network request through `StacNetworkRequest` and show another snackbar right after.
20+
21+
```json
22+
{
23+
"actionType": "multiAction",
24+
"sync": true,
25+
"actions": [
26+
{
27+
"actionType": "showSnackBar",
28+
"content": {
29+
"type": "text",
30+
"data": "Executing request..."
31+
},
32+
"action": {
33+
"label": "Done",
34+
"textColor": "#73C2FB",
35+
"onPressed": {}
36+
},
37+
"behavior": "floating"
38+
},
39+
{
40+
"actionType": "networkRequest",
41+
"url": "https://example.com/api",
42+
"method": "get",
43+
"queryParameters": {
44+
"page": 1
45+
},
46+
"headers": {
47+
"Authorization": "Bearer token"
48+
},
49+
"contentType": "application/json",
50+
"body": {
51+
"data": "example"
52+
},
53+
"results": [
54+
{
55+
"statusCode": 200,
56+
"action": {
57+
"actionType": "none"
58+
}
59+
},
60+
{
61+
"statusCode": 404,
62+
"action": {
63+
"actionType": "none"
64+
}
65+
}
66+
]
67+
},
68+
{
69+
"actionType": "showSnackBar",
70+
"content": {
71+
"type": "text",
72+
"data": "Request executed"
73+
},
74+
"action": {
75+
"label": "Done",
76+
"textColor": "#73C2FB",
77+
"onPressed": {}
78+
},
79+
"behavior": "floating"
80+
}
81+
]
82+
}
83+
```

0 commit comments

Comments
 (0)