Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ionic-framework/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Flutter UserUpdateInfo未定义名称';用户';_Flutter_Firebase Authentication - Fatal编程技术网

Flutter UserUpdateInfo未定义名称';用户';

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

由于更新Firebase auth,我需要更改一些不推荐使用的代码。 我在迁移指南上看到:

中断:在使用updateProfile支持命名参数时删除了UpdateUserInfo类。

我已经更新了它的大部分,但我仍然得到一个错误

// 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);