1

I thought that I had updated Android Studio to the latest version of Flutter/dart; however, I am unable to use any of the new features like the 'late' keyword as I can do in DartPad; please see the image below for an example.

enter image description here

I believe that I am currently up-to-date on updates, I've even re-installed Android Studio:

enter image description here

Question: Is there something that needs to be done to use all of the latest versions?

I am completely stumped here and any help would be appreciated. Also, I hope that this is an acceptable topic for discussion.

George Lee
  • 814
  • 18
  • 34

1 Answers1

4

The late keyword is a feature of null safety. You will need to migrate your project. If it is a new project, it can be as simple as running dart migrate in the project dir and accepting all changes. If you have an existing project, you may need to do more.

Further details here: https://dart.dev/null-safety/migration-guide

Stephen
  • 4,041
  • 22
  • 39
  • Thanks for the assistance Stephen, I also found this link for being useful as well: https://stackoverflow.com/questions/64621051/how-to-enable-null-safety-in-flutter – George Lee Apr 11 '21 at 08:02