2
How to do the if/else
in a row on Dart/Flutter?
Type: variavel ? null : function() : function2()
2
How to do the if/else
in a row on Dart/Flutter?
Type: variavel ? null : function() : function2()
6
You can do it like this:
Comparison ?
Value if true :
False value;
Ex.:
void main() {
for (int i = 0; i < 5; i++) {
var result = i % 2 == 0 ? print("$i - par") : print("$i - impar");
}
}
Browser other questions tagged mobile dart
You are not signed in. Login or sign up in order to post.
variable == null ? Function() function2()
– Nelson Aguiar