See below the logic operators:
Operators | Action | |
---|---|---|
condition() | The condition operator checks two elements and verifies which one is the real condition. | |
not() | The negation operator where the input is a only one value and the function is to reverse this value. | |
and() | The operator receives two inputs and the result is a TRUE value. If the two inputs values are TRUE, if not the result is FALSE. | |
or() | The operator receives two inputs AND the result is a TRUE value, if at least ONE of the two operation inputs is TRUE, if not the result is FALSE. |
In this example there is a screen that uses two logic operations, condition
and or
. There are two possibilities:
or
result is true, the Text
component text becomes true.fun screen() = Screen(
navigationBar = NavigationBar(title = "Operations", showBackButton = true),
fun screen() = Screen(
navigationBar = NavigationBar(title = "Operations", showBackButton = true),
child = Container(
children = listOf(
Text(text = constant("The text in green below will show if the result of `TRUE OR FALSE")),
Text(condition(or(constant(true), constant(false)), constant(true), constant(false)).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.