See them below:
Operator | Example | Action |
---|---|---|
isNull | isNull(expressionOf("@{context}") | The operator verifies if the parameter is null. |
isEmpty | isEmpty(expressionOf("@{context}") | The operator receives an input and verifies if it is empty. |
length | length(expressionOf("@{context}") | The operator receives an input and returns the length. |
The example below shows a context with numbersArray ID with the value [0, 1, 2, 3, 4] and the operation length
was used in the Text
component to get the length of this array, see below:
fun screen() = Screen(
child = Container(
context = ContextData(id = "numbersArray", value = arrayOf(0, 1, 2, 3, 4)),
children = listOf(
Text(text = "Array [0, 1, 2, 3, 4] has size: "),
Container(
children = listOf(
Text(length(expressionOf("@{numbersArray}")).toBindString())
)
).setStyle { backgroundColor = constant("#00FF00") }
)
)
)
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.