flutter --flow-control-collections are needed, but are they?

Hey, I had the same issue this morning but found a fix.

1) Keep the analysis_options.yaml in your root folder with this code:

analyzer:
  enable-experiment:
    - control-flow-collections

2) Don't use brackets {} in between your for loops Ex:

<Widget>[
  for (final category in categories) 
    CategoryWidget(category: category)
],

3) Important step which is probably why it's not working for you: Change your Dart version constraint in the pubspec.yml file in your root folder to 2.5.2

environment:
  sdk: ">=2.5.2 <3.0.0"

Change dart version in pubspec.yml

environment:
  sdk: ">=2.6.0 <3.0.0"

then

 flutter pub get
 flutter clean

And restart Android Studio