未为“FirebaseAuth”类型定义方法“signWithGoogle”

时间:2021-05-12 12:24:37

标签: flutter dart

我正在尝试使用 signInWithGoogle 添加 firebaseAuth,但没有成功。代码如下

enter image description here

//signInWithGoogle 代码(不起作用)

User firebaseUser = await firebaseAuth.signInWithGoogle(
    idToken: googleSignInAuthentication.idToken,
    accessToken: googleSignInAuthentication.accessToken);

//pubspec.yaml 文件

    dependencies:
  flutter:
    sdk: flutter  
  cupertino_icons: ^1.0.2
  carousel_slider: ^3.0.0
  js: ^0.6.3  
  flutter_signin_button: ^2.0.0  
  firebase_auth: ^1.1.4
  cloud_firestore: ^2.1.0
  google_sign_in: ^5.0.2
  shared_preferences: ^2.0.5
  fluttertoast: ^8.0.6

1 个答案:

答案 0 :(得分:0)

它不存在于 firebase_auth 中。请在您的 pubspec 中加入:google_sign_in

整个文档都在 pub.dev 上

相关问题