我升级了我的Flutter,我发现了一些错误
现版本如下:
Flutter 3.10.6 Dart 3.0.6 DevTools 2.23.1*
当我运行flutter pub get
时,我看到下面的消息:
目前Dart SDK版本为3.0.6。
由于flutter_app依赖于flutter_staggered_grid_view >=0.1.1 <0.4.0-nullsafety.1,不支持空安全性,版本解析失败。
“sdk:'>=1.19.0 <3.0.0'“必须为2.12.0或更高版本才能启用空安全性。有关详细信息,请参阅https://dart.dev/null-safety Flutter CLI开发人员工具使用Google Analytics报告使用情况和诊断数据沿着包依赖项,并使用崩溃报告发送基本的崩溃报告。这些数据用于帮助改进Dart平台、Flutter框架和相关工具。
第一次运行时不发送遥测。要禁用遥测报告,请运行以下终端命令:
Flutter --禁用遥测。如果您选择退出遥测,将发送一个选择退出事件,然后不会发送任何进一步的信息。这些数据是根据Google隐私政策(https://policies.google.com/privacy)收集的。
请注意,分析报告已被禁用,并将继续被禁用。
进程已完成,退出代码为% 1
pubspic.yml
name: Flutter App
description: A new Flutter project.
version: 1.0.0+1
environment:
sdk: ">=2.12.0 <3.0.0"
dependencies:
flutter:
sdk: flutter
shared_preferences: ^2.0.15
provider: ^6.0.3
flutter_svg: ^1.1.4
image_picker: ^0.8.6
flutter_launcher_icons: ^0.9.2
smooth_page_indicator: ^1.0.0+2
carousel_slider: ^4.1.1
firebase_core: ^1.20.1
cloud_firestore: ^3.4.4
firebase_auth: ^3.6.3
flutter_facebook_auth: ^4.4.1
google_sign_in: ^5.4.1
flutter_iconly: ^1.0.2
flutter_local_notifications: ^9.6.1
loader_overlay: ^2.0.7
flutter_spinkit: ^5.1.0
get:
lottie:
json_annotation:
google_fonts: ^2.3.1
flutter_secure_storage: ^5.0.2
flutter_staggered_grid_view: ^0.3.2
edge_alerts: ^0.0.1
mongo_dart: ^0.7.4+1
easy_localization: ^3.0.2-dev
geoflutterfire: ^3.0.3
flutter_native_image: ^0.0.6+1
firebase_storage: ^10.3.6
firebase_messaging: ^12.0.3
flutter_shapes:
crypt:
progress_dialog:
cached_network_image: ^3.2.1
cupertino_icons: ^1.0.2
dev_dependencies:
firebase_core_platform_interface: 4.5.1
flutter_test:
sdk: flutter
flutter_lints: ^1.0.0
flutter:
uses-material-design: true
assets:
- assets/icons/
- assets/icons/account_icons/
- assets/icons/departments/
- assets/images/
- assets/animations/
字符串
2条答案
按热度按时间tquggr8v1#
更改pubspec中的sdk值并升级pubspec.yaml中添加的依赖项
aor9mmx12#
您使用的是一个非常旧的flutter_staged_grid_view版本,它不支持空安全。尝试编辑pubspec.yaml文件以使用更新的版本。
https://pub.dev/packages/flutter_staggered_grid_view/versions
举例来说:
字符串
您还需要更新pubspec.yaml文件中指定的flutter版本。
然后就跑扑酒馆去了。