Him*_*rma 3 firebase firebase-authentication flutter
我将 firebase_auth 升级到 ^0.18.0+1,但出现了一些错误:
我修复了上面的问题,但无法修复下面的问题:
我该如何解决这个问题?我应该创建一个 var 并将其传递到 updateInfo 方法中吗?
FirebaseAuth api 在版本 0.18.0 中已更改。https://firebase.flutter.dev/docs/migration#authentication
UserUpdateInfo 类已被删除,以支持命名参数,并且 currentUser() 方法不再是异步的。
前:
await FirebaseAuth.instance.currentUser().then((val) async {
final userUpdateInfo = UserUpdateInfo();
userUpdateInfo.displayName =
'${appleIdCredential.fullName.givenName} ${appleIdCredential.fullName.familyName}';
userUpdateInfo.photoUrl = 'define an url';
await val.updateProfile(userUpdateInfo);
});
Run Code Online (Sandbox Code Playgroud)
后:
await FirebaseAuth.instance.currentUser.updateProfile(
displayName:
'${appleIdCredential.fullName.givenName} ${appleIdCredential.fullName.familyName}',
photoURL: 'define an url',
);
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2324 次 |
| 最近记录: |