Flutter | Dart : Target of URI does not exist

Posted by

Error:

Target of URI doesn't exist: 'package:path_provider/path_provider.dart'. Try creating the file referenced by the URI, or try using a URI for a file that does exist.darturi_does_not_exist Type: String

Solution:

It is evident from the error message that the path_provider package cannot be located. This package offers ways to reach frequently visited filesystem locations.

You must include the path_provider package in your pubspec.yaml file in order to fix this problem:

After adding the package, run flutter pub get in your terminal to fetch the package.

Then, you can import the path_provider package in your main.dart file:

Now that you have the path to the directory where the application may store user-generated or otherwise non-replicable material, you should be able to use the getApplicationDocumentsDirectory function to retrieve it.

Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x