My flutter project suddenly has a new error in any files that have a stateful or stateless widget (which uses the Material or Cupertino library):
"info: The imported package 'flutter' isn't a dependency of the importing package."
Usually if I need to import say the material library, I can right click on a flutter widget and there is an option to import it. However, this option is no longer available, so it appears there is some error or conflict with flutter SDK.
I have ran flutter clean, upgraded flutter version to no avail, and not sure how to fix the issue?
This error shows up when you removed the flutter dependency from the pubspec.yaml
file. Make sure you have this there:
dependencies:
flutter:
sdk: flutter