upgrade Flutter SDK to the last version and get and Error with If in the column of widget while using if to show one of widget after setstate and variable be true as shown in the image enter image description here
Asked
Active
Viewed 810 times
0
-
What is the Dart SDK constraint in your `pubspec.yaml` file? – jamesdlin May 08 '20 at 05:04
-
Does this answer your question? [flutter --flow-control-collections are needed, but are they?](https://stackoverflow.com/questions/59458433/flutter-flow-control-collections-are-needed-but-are-they) – jamesdlin May 21 '20 at 15:11
3 Answers
0
Here they talk about other flutter update. They said you should upgrade your min Dart version at pubspec.yaml Not sure if it will work but it's a similar issue than yours.
Maybe as a temp fix you could try the sintax: Condition ? True : False
Ups, I forgot the link :) flutter --flow-control-collections are needed, but are they?

Rubén Cantón
- 124
- 7
0
You can fix this by replacing the if else
statement with Ternary operators
.
Ternary Operators
are shorter ways of if-else
statement. Syntax is :
testCondition ? trueValue : falseValue
Check the code below: it works fine.
_isLoading
? CircularProgressIndicator()
: RaisedButton(
onPressed: () {},
child: Text('Sign up'),
),
I hope this helps.

void
- 12,787
- 3
- 28
- 42