ifTrue or ifFalse widget.
Properties
Example
- Dart
- JSON
- Preview
Conditional with Complex Widgets
Condition Expression Syntax
Thecondition property accepts expressions that are evaluated against the current state. Common patterns include:
- Equality:
user.role == 'admin' - Boolean check:
user.isVerified == true - Comparison:
cart.total > 100 - Length check:
items.length > 0 - Null check:
user.name != null
The condition is evaluated at runtime by Stac’s expression resolver against the current application state.