The PullToRefresh component configures a native “pull to refresh” behavior for the child component.
The structure is represented by the attributes below:
Attribute | Type | Required | Definition |
---|---|---|---|
context | ContextData | Defines a context for the component. | |
onPull | List<Action> | List of actions that are performed when the child component is pulled. | |
isRefreshing | Boolean or Binding | Expression that controls when the loading indicator is shown. | |
color | String or Binding | Defines the color of the loading indicator. | |
child | ServerDrivenComponent | ✓ | Defines the component that will be configured with the PullToRefresh. |
UIRefreshControl
on the child if it is a ListView, GridView or ScrollView, otherwise it creates a ScrollView
that contains the child and configures an UIRefreshControl
for it.Container(
children = listOf(
PullToRefresh(
context = ContextData("isRefreshing", false),
onPull = listOf(
SetContext(
contextId = "isRefreshing",
value = true
),
Alert(
title = "Alert title",
message = "Alert message",
onPressOk =
SetContext(
contextId = "isRefreshing",
value = false
),
labelOk = "Alert OK button"
)
),
isRefreshing = expressionOf("@{isRefreshing}"),
color = "#0000FF",
child = Text("PullToRefresh")
)
)
).setFlex {
grow = 1.0
}
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.