Flutter Target of URI doesn’t exist package:http/http.dart Error

The http.dart package file contains high level function and classes to manage and retrieve HTTP resources. The package file is fully platform independent and can run on both Android and iOS platforms. The http.dart package comes inbuilt with older flutter version but now we have to manually import and configure this into our project. So in this tutorial we would Solve Target of URI doesn’t exist package:http/http.dart Error in Flutter iOS android project.

How this error looks like:

Flutter Target of URI doesn't exist package:http/http.dart Error

Error Text:

Target of URI doesn’t exist: ‘package:http/http.dart’ . Try Creating the file referenced by the URI, our Try using a URI for a file that dose exist. dart (uri_dose_not_exist), No quick fix available.

Contents in this project Target of URI doesn’t exist package:http/http.dart Error Solution in Flutter:

1. To solve this error first we need to open pubspec.yaml file present in our Flutter project.

2. Open pubspec.yaml file in Visual Studio Code, Android Studio our Notepad ++ editor. Find line dependencies: and put http: ^0.12.0 just right after it and Save the file.

Complete source code of my pubspec.yaml file:

3. Open flutter project folder in Command Prompt or Terminal and execute flutter pub get command. This command would download and install the newly added http library.

4. After executing above command, it will download and install the http.dart package in our project.

Here you guys, Now the http.dart package will be successfully download in your project and the just reopen project again in editor 🙂 .

Leave a Reply

Your email address will not be published. Required fields are marked *