[英]_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.