I am using super keyword in initState method.but i am getting this error 'This requires the 'super-parameters' language feature to be enabled. Try updating your pubspec.yaml to set the minimum SDK constraint to 2.16.0 or higher, and running 'pub get'.dart(experiment_not_enabled)'.Need help please.
Asked
Active
Viewed 1.9k times
24
-
1Can you include your code-snippet ? – Md. Yeasin Sheikh May 11 '22 at 08:16
-
Please provide enough code so others can better understand or reproduce the problem. – Dani3le_ May 11 '22 at 15:27
-
I'm getting this message whenever I try to use `super.param` the same way I use `this.param` in a constructor. It's a relatively new feature in Dart. – Aknahseh_tg May 11 '22 at 19:58
4 Answers
19
super-parameters
were added in Dart 2.17.0
.
If you're not already using the latest version, run
flutter upgrade
To use super-parameters
in your app, open your pubspec.yaml
file and update sdk
to target min 2.17.0
:
environment:
sdk: ">=2.17.0 <3.0.0"

CopsOnRoad
- 237,138
- 77
- 654
- 440
-
4
-
1I'm having same issue. Running Dart 2.18.6, did ```flutter upgrade``` and ```flutter pub get``` afterwards. same thing. Any idea what else could be wrong? – Bashar Abdullah Dec 26 '22 at 20:54
7
Also, if you have
environment:
sdk: ">=2.17.0 <3.0.0"
and you still have an error, try to upgrade you dependencies:
flutter packages upgrade

Byte Byte
- 71
- 1
- 4
0
change 2.16 to 2.17 in pubspec.yaml file that solved my problem don't do upgrade after that

SHUBHAM Kaushik
- 1
- 1
-
Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community May 24 '23 at 12:31