Beagle v1.7 is no longer actively maintained. The documented version you are viewing may contain deprecated functionality. For up-to-date documentation, see the latest version .
It is an action that has a boolean parameter and, according to the value, the action runs onTrue or onFalse.
Attribute | Type | Required | Definition |
---|---|---|---|
condition | Boolean or Binding | ✓ | Condition to define which action will run. |
onTrue | List<Action> | List of actions that it will be run when the condition is true. | |
onFalse | List<Action> | List of actions that it will be run when the condition is false. |
The example below is a Container
with a context that has a 18 value and the event onPress
of the button is defined as an action with the Condition
type, that verifies if the values is the same as 21 and shows an Alert
depending on the context value.
Container(
context = ContextData(
id = "age",
value = 18
),
children = listOf(
Button(
text = "Is equal to 21?",
onPress = listOf(
Condition(
condition = "@{eq(age, 21)}",
onTrue = listOf(
Alert(message = "The condition is true")
),
onFalse = listOf(
Alert(message = "The condition is false")
)
)
)
)
)
)
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.