Recently I tried to graft some code acquired online into a local Flutter project.
But the IDE (Android Studio) was underlining various parts of it in red like so:
More detail about the errors:
I tried editting pubspec.yaml but couldn't find where or how to do what it is suggesting.
I'm currenly assuming that the reason this code is underlined like that is because it is written in a more recent version of Dart than what I have installed. Let me know if that is wrong so I can edit/delete this question.
I tried researching the changelog for the Dart language features but could not get meaningful results.
The version of Dart I have installed (the Dart plugin version) is 201.9335.
How can I upgrade this to the latest version of Dart?
I tried right clicking it, but the was no context menu let alone any upgrade option.
There is no upgrade option I can see within Android Studio, only the option to uninstall it.
I also tried going to the Dart plugin homepage and downloading the latest version, then choosing the downloaded jar file to install using Android Studio, but it seemed to just do nothing -- no error -- no success -- no change.
How do you upgrade the Dart plugin in Android Studio to the latest version?



