英文:
he argument type 'Future<void> Function()' can't be assigned to the parameter type 'Future<void> Function(App)?'
问题
在运行 Flutter 后,我收到了以下错误:
/C:/Users/username/AppData/Local/Pub/Cache/hosted/pub.dev/firebase_auth_web-5.2.4/lib/firebase_auth_web.dart:92:45: 错误: 无法将参数类型 'Future<void> Function()' 分配给参数类型 'Future<void> Function(App)?'。
- 'Future' 来自 'dart:async'。
- 'App' 来自 'package:firebase_core_web/src/interop/app.dart'
('/C:/Users/username/AppData/Local/Pub/Cache/hosted/pub.dev/firebase_core_web-2.2.2/lib/src/interop/app.dart')。
FirebaseCoreWeb.registerService('auth', () async {
尝试过 flutter clean 并下载了 Flutter Core Web。
英文:
I recieve this error after flutter run
/C:/Users/username/AppData/Local/Pub/Cache/hosted/pub.dev/firebase_auth_web-5.2.4/lib/firebase_auth_web.dart:92:45: Error: The argument
type 'Future<void> Function()' can't be assigned to the parameter type 'Future<void> Function(App)?'.
- 'Future' is from 'dart:async'.
- 'App' is from 'package:firebase_core_web/src/interop/app.dart'
('/C:/Users/username/AppData/Local/Pub/Cache/hosted/pub.dev/firebase_core_web-2.2.2/lib/src/interop/app.dart').
FirebaseCoreWeb.registerService('auth', () async {
Tried flutter clean and downloaded flutter core web
答案1
得分: 1
项目依赖项的升级对我有效。使用以下命令
flutter pub upgrade
flutter pub get
英文:
Upgrading the project dependencies worked for me. Use the commands below
flutter pub upgrade
flutter pub get
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论