Flutter UserUpdateInfo未定义名称';用户';
由于更新Firebase auth,我需要更改一些不推荐使用的代码。 我在迁移指南上看到: 中断:在使用updateProfile支持命名参数时删除了UpdateUserInfo类。 我已经更新了它的大部分,但我仍然得到一个错误Flutter UserUpdateInfo未定义名称';用户';,flutter,firebase-authentication,Flutter,Firebase Authentication,由于更新Firebase auth,我需要更改一些不推荐使用的代码。 我在迁移指南上看到: 中断:在使用updateProfile支持命名参数时删除了UpdateUserInfo类。 我已经更新了它的大部分,但我仍然得到一个错误 // Update the username await updateUserName(name, authResult.user); return authResult.user.uid; } } 错误=未定义的名称“user”。也许您想按名称使用currentUs
// Update the username
await updateUserName(name, authResult.user);
return authResult.user.uid;
}
}
错误=未定义的名称“user”。也许您想按名称使用
currentUser
参数,而不是user
FirebaseAuth.instance.currentUser.updateProfile(displayName: currentUser.displayName);
谢谢,先生,这似乎解决了这个错误
FirebaseAuth.instance.currentUser.updateProfile(displayName: currentUser.displayName);