Flutter: How to resolve Error importing package:http/http.dart
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}
I am very new to Flutter, and stuck at the following error:
package:http/http.dart That library is in a package that is not known. Maybe you forgot to mention it in your pubspec.yaml file?
Please help in resolving this error.
dart flutter
add a comment |
I am very new to Flutter, and stuck at the following error:
package:http/http.dart That library is in a package that is not known. Maybe you forgot to mention it in your pubspec.yaml file?
Please help in resolving this error.
dart flutter
that package is part of flutter and should not show an error if you import it. To help you, you should post your relevant parts of the pubspec.yaml and .dart-File
– Christian
Nov 24 '18 at 22:37
The package is not a part of flutter but it is distributed via pub.
– Jonah Williams
Nov 25 '18 at 0:02
please google this before putting it up here, just search http/http.dart, you will get dartlang packages page(pub.dartlang.org/packages/http). the documentation and usage is pretty detailed.
– sudesh
Mar 16 at 14:25
add a comment |
I am very new to Flutter, and stuck at the following error:
package:http/http.dart That library is in a package that is not known. Maybe you forgot to mention it in your pubspec.yaml file?
Please help in resolving this error.
dart flutter
I am very new to Flutter, and stuck at the following error:
package:http/http.dart That library is in a package that is not known. Maybe you forgot to mention it in your pubspec.yaml file?
Please help in resolving this error.
dart flutter
dart flutter
edited Nov 24 '18 at 21:48
Athar Ansari
asked Nov 24 '18 at 21:24
Athar AnsariAthar Ansari
5914
5914
that package is part of flutter and should not show an error if you import it. To help you, you should post your relevant parts of the pubspec.yaml and .dart-File
– Christian
Nov 24 '18 at 22:37
The package is not a part of flutter but it is distributed via pub.
– Jonah Williams
Nov 25 '18 at 0:02
please google this before putting it up here, just search http/http.dart, you will get dartlang packages page(pub.dartlang.org/packages/http). the documentation and usage is pretty detailed.
– sudesh
Mar 16 at 14:25
add a comment |
that package is part of flutter and should not show an error if you import it. To help you, you should post your relevant parts of the pubspec.yaml and .dart-File
– Christian
Nov 24 '18 at 22:37
The package is not a part of flutter but it is distributed via pub.
– Jonah Williams
Nov 25 '18 at 0:02
please google this before putting it up here, just search http/http.dart, you will get dartlang packages page(pub.dartlang.org/packages/http). the documentation and usage is pretty detailed.
– sudesh
Mar 16 at 14:25
that package is part of flutter and should not show an error if you import it. To help you, you should post your relevant parts of the pubspec.yaml and .dart-File
– Christian
Nov 24 '18 at 22:37
that package is part of flutter and should not show an error if you import it. To help you, you should post your relevant parts of the pubspec.yaml and .dart-File
– Christian
Nov 24 '18 at 22:37
The package is not a part of flutter but it is distributed via pub.
– Jonah Williams
Nov 25 '18 at 0:02
The package is not a part of flutter but it is distributed via pub.
– Jonah Williams
Nov 25 '18 at 0:02
please google this before putting it up here, just search http/http.dart, you will get dartlang packages page(pub.dartlang.org/packages/http). the documentation and usage is pretty detailed.
– sudesh
Mar 16 at 14:25
please google this before putting it up here, just search http/http.dart, you will get dartlang packages page(pub.dartlang.org/packages/http). the documentation and usage is pretty detailed.
– sudesh
Mar 16 at 14:25
add a comment |
5 Answers
5
active
oldest
votes
Go to your pubspec.yaml
file , and add the http
dependency:
dependencies:
flutter:
sdk: flutter
cupertino_icons: ^0.1.2
http: any
Remember, the indentation must be the same as 'flutter' or 'cupertino_icons'
3
And don't for get topub get
orflutter packages get
after saving.
– Nate Bosch
Nov 25 '18 at 4:21
add a comment |
I had the same problem. You just have to add latest http dependencies in pubspec.yaml
Here is the full code,
dependencies:
flutter:
sdk: flutter
http: ^0.12.0+1
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^0.1.2
Don't forget to change verson no. of http
To check latest version of http click here
If you are running app directly from command line then you could also do:
with Flutter:
$ flutter packages get
with pub:
$ pub get
(upvoted) and thanks for the link too!
– NightSkyDev
Feb 6 at 13:28
add a comment |
just got to pubspec.yaml file and tweak some changes in file
dependencies:
flutter:
sdk: flutter
cupertino_icons: ^0.1.2
http:
under dependencies section just add http like in code description .
flutter will automatically resolve it and will add updated version of http .
add a comment |
this worked for me:
dependencies:
flutter:
sdk: flutter
cupertino_icons: ^0.1.2
http: any
then:
flutter doctor -v
Finally:
flutter packages get
add a comment |
add below to pubspec.ymel file
dependencies:
flutter:
sdk: flutter
cupertino_icons: ^0.1.2
http: ^0.12.0+1
use flutter pub to find the latest version
call
flutter packages get
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53462488%2fflutter-how-to-resolve-error-importing-packagehttp-http-dart%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
5 Answers
5
active
oldest
votes
5 Answers
5
active
oldest
votes
active
oldest
votes
active
oldest
votes
Go to your pubspec.yaml
file , and add the http
dependency:
dependencies:
flutter:
sdk: flutter
cupertino_icons: ^0.1.2
http: any
Remember, the indentation must be the same as 'flutter' or 'cupertino_icons'
3
And don't for get topub get
orflutter packages get
after saving.
– Nate Bosch
Nov 25 '18 at 4:21
add a comment |
Go to your pubspec.yaml
file , and add the http
dependency:
dependencies:
flutter:
sdk: flutter
cupertino_icons: ^0.1.2
http: any
Remember, the indentation must be the same as 'flutter' or 'cupertino_icons'
3
And don't for get topub get
orflutter packages get
after saving.
– Nate Bosch
Nov 25 '18 at 4:21
add a comment |
Go to your pubspec.yaml
file , and add the http
dependency:
dependencies:
flutter:
sdk: flutter
cupertino_icons: ^0.1.2
http: any
Remember, the indentation must be the same as 'flutter' or 'cupertino_icons'
Go to your pubspec.yaml
file , and add the http
dependency:
dependencies:
flutter:
sdk: flutter
cupertino_icons: ^0.1.2
http: any
Remember, the indentation must be the same as 'flutter' or 'cupertino_icons'
answered Nov 25 '18 at 3:35
diegoveloperdiegoveloper
15.9k12636
15.9k12636
3
And don't for get topub get
orflutter packages get
after saving.
– Nate Bosch
Nov 25 '18 at 4:21
add a comment |
3
And don't for get topub get
orflutter packages get
after saving.
– Nate Bosch
Nov 25 '18 at 4:21
3
3
And don't for get to
pub get
or flutter packages get
after saving.– Nate Bosch
Nov 25 '18 at 4:21
And don't for get to
pub get
or flutter packages get
after saving.– Nate Bosch
Nov 25 '18 at 4:21
add a comment |
I had the same problem. You just have to add latest http dependencies in pubspec.yaml
Here is the full code,
dependencies:
flutter:
sdk: flutter
http: ^0.12.0+1
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^0.1.2
Don't forget to change verson no. of http
To check latest version of http click here
If you are running app directly from command line then you could also do:
with Flutter:
$ flutter packages get
with pub:
$ pub get
(upvoted) and thanks for the link too!
– NightSkyDev
Feb 6 at 13:28
add a comment |
I had the same problem. You just have to add latest http dependencies in pubspec.yaml
Here is the full code,
dependencies:
flutter:
sdk: flutter
http: ^0.12.0+1
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^0.1.2
Don't forget to change verson no. of http
To check latest version of http click here
If you are running app directly from command line then you could also do:
with Flutter:
$ flutter packages get
with pub:
$ pub get
(upvoted) and thanks for the link too!
– NightSkyDev
Feb 6 at 13:28
add a comment |
I had the same problem. You just have to add latest http dependencies in pubspec.yaml
Here is the full code,
dependencies:
flutter:
sdk: flutter
http: ^0.12.0+1
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^0.1.2
Don't forget to change verson no. of http
To check latest version of http click here
If you are running app directly from command line then you could also do:
with Flutter:
$ flutter packages get
with pub:
$ pub get
I had the same problem. You just have to add latest http dependencies in pubspec.yaml
Here is the full code,
dependencies:
flutter:
sdk: flutter
http: ^0.12.0+1
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^0.1.2
Don't forget to change verson no. of http
To check latest version of http click here
If you are running app directly from command line then you could also do:
with Flutter:
$ flutter packages get
with pub:
$ pub get
edited Jan 28 at 6:15
ray
3,3731829
3,3731829
answered Jan 28 at 5:51
Akshat TamrakarAkshat Tamrakar
773
773
(upvoted) and thanks for the link too!
– NightSkyDev
Feb 6 at 13:28
add a comment |
(upvoted) and thanks for the link too!
– NightSkyDev
Feb 6 at 13:28
(upvoted) and thanks for the link too!
– NightSkyDev
Feb 6 at 13:28
(upvoted) and thanks for the link too!
– NightSkyDev
Feb 6 at 13:28
add a comment |
just got to pubspec.yaml file and tweak some changes in file
dependencies:
flutter:
sdk: flutter
cupertino_icons: ^0.1.2
http:
under dependencies section just add http like in code description .
flutter will automatically resolve it and will add updated version of http .
add a comment |
just got to pubspec.yaml file and tweak some changes in file
dependencies:
flutter:
sdk: flutter
cupertino_icons: ^0.1.2
http:
under dependencies section just add http like in code description .
flutter will automatically resolve it and will add updated version of http .
add a comment |
just got to pubspec.yaml file and tweak some changes in file
dependencies:
flutter:
sdk: flutter
cupertino_icons: ^0.1.2
http:
under dependencies section just add http like in code description .
flutter will automatically resolve it and will add updated version of http .
just got to pubspec.yaml file and tweak some changes in file
dependencies:
flutter:
sdk: flutter
cupertino_icons: ^0.1.2
http:
under dependencies section just add http like in code description .
flutter will automatically resolve it and will add updated version of http .
answered Mar 28 at 7:01
Ali BabaAli Baba
257
257
add a comment |
add a comment |
this worked for me:
dependencies:
flutter:
sdk: flutter
cupertino_icons: ^0.1.2
http: any
then:
flutter doctor -v
Finally:
flutter packages get
add a comment |
this worked for me:
dependencies:
flutter:
sdk: flutter
cupertino_icons: ^0.1.2
http: any
then:
flutter doctor -v
Finally:
flutter packages get
add a comment |
this worked for me:
dependencies:
flutter:
sdk: flutter
cupertino_icons: ^0.1.2
http: any
then:
flutter doctor -v
Finally:
flutter packages get
this worked for me:
dependencies:
flutter:
sdk: flutter
cupertino_icons: ^0.1.2
http: any
then:
flutter doctor -v
Finally:
flutter packages get
answered Mar 3 at 5:40
Diego Santa Cruz MendezúDiego Santa Cruz Mendezú
1,122911
1,122911
add a comment |
add a comment |
add below to pubspec.ymel file
dependencies:
flutter:
sdk: flutter
cupertino_icons: ^0.1.2
http: ^0.12.0+1
use flutter pub to find the latest version
call
flutter packages get
add a comment |
add below to pubspec.ymel file
dependencies:
flutter:
sdk: flutter
cupertino_icons: ^0.1.2
http: ^0.12.0+1
use flutter pub to find the latest version
call
flutter packages get
add a comment |
add below to pubspec.ymel file
dependencies:
flutter:
sdk: flutter
cupertino_icons: ^0.1.2
http: ^0.12.0+1
use flutter pub to find the latest version
call
flutter packages get
add below to pubspec.ymel file
dependencies:
flutter:
sdk: flutter
cupertino_icons: ^0.1.2
http: ^0.12.0+1
use flutter pub to find the latest version
call
flutter packages get
answered Mar 16 at 1:54
SamSam
3,07675073
3,07675073
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53462488%2fflutter-how-to-resolve-error-importing-packagehttp-http-dart%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
that package is part of flutter and should not show an error if you import it. To help you, you should post your relevant parts of the pubspec.yaml and .dart-File
– Christian
Nov 24 '18 at 22:37
The package is not a part of flutter but it is distributed via pub.
– Jonah Williams
Nov 25 '18 at 0:02
please google this before putting it up here, just search http/http.dart, you will get dartlang packages page(pub.dartlang.org/packages/http). the documentation and usage is pretty detailed.
– sudesh
Mar 16 at 14:25