我正在flutter docs中研究抖动网络。我完全按照指南进行操作,但是当我添加http依赖项,然后单击Packages get
时出现错误。怎么了?感谢您的任何建议。
dependencies:
flutter:
sdk: flutter
qrscan: ^0.2.17
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^0.1.3
http: ^0.12.2 // http dependency I added
错误信息在下面
Running "flutter pub get" in myProject...
Unexpected character (at character 1)
<html>
^
dart:convert jsonDecode
package:pub/src/source/hosted.dart 190:17 BoundHostedSource._fetchVersions
===== asynchronous gap ===========================
dart:async _CustomZone.runUnary
package:pub/src/rate_limited_scheduler.dart 82:30 RateLimitedScheduler._processNextTask.runJob
package:pub/src/rate_limited_scheduler.dart 85:30 RateLimitedScheduler._processNextTask
dart:async new Future.sync
package:pool/pool.dart 126:18 Pool.withResource.<fn>
This is an unexpected error. Please run
pub --trace '--verbosity=warning' get --no-precompile
and include the logs in an issue on https://github.com/dart-lang/pub/issues/new
pub get failed (65; and include the logs in an issue on https://github.com/dart-lang/pub/issues/new)
Process finished with exit code 65
答案 0 :(得分:-1)
dependencies:
flutter:
sdk: flutter
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^0.1.3
http: ^0.12.2 // http dependency I added
qrscan: ^0.2.17
请按此顺序编写代码