Debugging in Dart: "required isn't a type"
This is an annoying bug that can occur in Flutter and Dart when you are trying to make certain parameters required.
Ew.
Ok, let's try changing the syntax a little bit.
K, so that's a bit more helpful.
What's in our pubspec.yaml for the minimum required SDK?
Oh. Maybe that's why.Change the version to >=2.12.0:
And then run pub get:
Looks successful.
And boom! The error is gone.
Warning: This will cause Dart to be way stricter about type safety, so you might get a zillion other errors in your project. So, the choice of what you want to deal with is up to you.
I had to add an extra argument to my run configurations:
Comments
Post a Comment