flutterdart

The imported package 'path' isn't a dependency of the importing package


I just upgraded my packages and now I started seeing a warning:

enter image description here

What is causing this?


Solution

  • One or some of your packages (mostly likely the path_provider) had path as transitive dependency before you upgraded to their latest version, so you were able to import path directly in your code.

    But the latest version no longer has dependency on path, so you will need to add this to your pubspec.yaml dependencies section like this:

    dependencies:
      path: any