O componente PullToRefresh configura um comportamento “pull to refresh” para o componente child.
A estrutura é representada como mostrado abaixo:
Atributo | Tipo | Obrigatório | Definição |
---|---|---|---|
context | ContextData | Define um context para o componente. | |
onPull | List<Action> | Lista de ações executadas quando o componente child é puxado. | |
isRefreshing | Boolean or Binding | Expressão que controla quando o indicador de carregamento é mostrado. | |
color | String or Binding | Define a cor do indicador de carregamento. | |
child | ServerDrivenComponent | ✓ | Define o componente que será configurado com o PullToRefresh. |
UIRefreshControl
no filho se ele é um ListView, GridView ou ScrollView, caso contrário cria-se um ScrollView
que contém o child e configura um UIRefreshControl
para ele.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.