he argument type 'Future<void> Function()' can't be assigned to the parameter type 'Future<void> Function(App)?'

huangapple go评论100阅读模式
英文:

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。

英文:

code for main

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

huangapple
  • 本文由 发表于 2023年3月12日 16:05:56
  • 转载请务必保留本文链接:https://go.coder-hub.com/75711796.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定