简体   繁体   English

firebase_auth插件升级到0.6.2 + 1后,缺少_firebaseAuth.updateProfile

[英]_firebaseAuth.updateProfile missing after firebase_auth plugin upgrade to 0.6.2+1

_firebaseAuth.updateProfile missing after firebase_auth plugin upgrade to 0.6.2+1 firebase_auth插件升级到0.6.2 + 1后,缺少_firebaseAuth.updateProfile

Upgrade firebase_auth plugin from 0.5.20 to 0.6.2+1 in pubspec.yaml and suddenly cannot compile my Flutter app. 将pubspec.yaml中的firebase_auth插件从0.5.20升级到0.6.2 + 1,突然无法编译我的Flutter应用。 The reason? 原因? updateProfile Method is missing. updateProfile方法丢失。 Why? 为什么? What happened? 发生了什么?

Cannot compile at all: 根本无法编译:

Compiler message:
lib/Screens/Profile/index.dart:549:20: Error: The method 'updateProfile' isn't defined for the class '#lib1::Auth'.
Try correcting the name to the name of an existing method, or defining a method named 'updateProfile'.
              auth.updateProfile(myInfo);
                   ^
lib/services/authentication.dart:164:25: Error: The method 'updateProfile' isn't defined for the class '#lib1::FirebaseAuth'.
Try correcting the name to the name of an existing method, or defining a method named 'updateProfile'.
    await _firebaseAuth.updateProfile(userUpdateInfo);

I found out why it is not compiling. 我发现了为什么不编译。

0.6.0 Added support for updatePassword in FirebaseUser. 0.6.0在FirebaseUser中添加了对updatePassword的支持。 Breaking Change Moved updateEmail and updateProfile to FirebaseUser. 重大更改将updateEmail和updateProfile移至FirebaseUser。 This brings the firebase_auth package inline with other implementations and documentation. 这使firebase_auth软件包与其他实现和文档内联。

The method has moved... 该方法已移动...

The Method is not Compiling because it's moved to class FireBaseUser so the Solution: 该方法未编译,因为它已移至FireBaseUser类,因此解决方案:

-Create instance from FirebaseUser: -从FirebaseUser创建实例:

FirebaseUser user = await _auth.signInWithCredential(credential);
var userUpdateInfo = UserUpdateInfo();
userUpdateInfo.displayName = 'name';
userUpdateInfo.photoUrl = "Image link";
user.updateProfile(userUpdateInfo);

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Flutter - firebase_auth updateProfile 方法不起作用 - Flutter - firebase_auth updateProfile method is not working auth.onAuthStateChanged 在 Firebase 中的 auth.currentUser.updateProfile 后未触发 - auth.onAuthStateChanged not triggering after auth.currentUser.updateProfile in Firebase 如何使用 firebase_auth 包修复 flutter 应用程序中的 FirebaseAuth.instance.currentUser()? 它总是返回 null - How to fix FirebaseAuth.instance.currentUser() in flutter app using firebase_auth package? It is always returning null Flutter:由于上述问题,无法构建插件 firebase_auth - Flutter:The plugin firebase_auth could not be built due to the issue above Flutter中来自firebase_auth插件的更多用户数据 - More user data from firebase_auth plugin in Flutter Firebase身份验证:Cloud Function中的updateProfile? - Firebase Auth: updateProfile in Cloud Function? 应用发布后的 firebase_auth/unknown 错误 - firebase_auth/unknown error after app release React Native Firebase 电话身份验证错误是:[firebase_auth/missing-client-identifier] 此请求缺少有效的应用标识符 - React Native Firebase Phone Auth Error is:[firebase_auth/missing-client-identifier] This request is missing a valid app identifier 插件 `firebase_auth` 没有在 C:\\Users\\ 中定义的主类 - The plugin `firebase_auth` doesn't have a main class defined in C:\Users\ Flutter firebase_auth signInWithCredential 不适用于 android - Flutter firebase_auth signInWithCredential is not working on android
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM