Properties
| Property | Type | Description |
|---|---|---|
| child | StacWidget | The widget below this widget in the tree. |
| displacement | double | The distance from the child’s top or bottom edge to where the refresh indicator starts. Defaults to 40. |
| edgeOffset | double | The offset where the indicator starts. Defaults to 0. |
| onRefresh | StacAction | The callback that is called when the user has dragged the refresh indicator far enough to demonstrate that they want the app to refresh. |
| color | StacColor | The color of the refresh indicator. |
| backgroundColor | StacColor | The background color of the refresh indicator. |
| semanticsLabel | String | The semantic label for the refresh indicator. |
| semanticsValue | String | The semantic value for the refresh indicator. |
| strokeWidth | double | The width of the refresh indicator’s stroke. Defaults to RefreshProgressIndicator.defaultStrokeWidth. |
| triggerMode | StacRefreshIndicatorTriggerMode | The mode that controls when the refresh indicator will be triggered. Defaults to RefreshIndicatorTriggerMode.onEdge. |
Example
- Dart
- JSON
- Preview
StacRefreshIndicator(
onRefresh: StacNetworkRequestAction(
url: 'https://raw.githubusercontent.com/StacDev/stac/main/examples/stac_gallery/assets/json/list_view_example.json',
method: Method.get,
contentType: 'application/json',
),
child: StacListView(
children: [
StacListTile(title: StacText(data: 'Pull down to refresh')),
StacListTile(title: StacText(data: 'Item 1')),
StacListTile(title: StacText(data: 'Item 2')),
StacListTile(title: StacText(data: 'Item 3')),
],
),
)
{
"type": "refreshIndicator",
"onRefresh": {
"actionType": "request",
"url": "https://raw.githubusercontent.com/StacDev/stac/main/examples/stac_gallery/assets/json/list_view_example.json",
"method": "get",
"contentType": "application/json"
},
"child": {
"type": "listView",
"children": [
{
"type": "listTile",
"title": {
"type": "text",
"data": "Pull down to refresh"
}
},
{
"type": "listTile",
"title": {
"type": "text",
"data": "Item 1"
}
},
{
"type": "listTile",
"title": {
"type": "text",
"data": "Item 2"
}
},
{
"type": "listTile",
"title": {
"type": "text",
"data": "Item 3"
}
}
]
}
}