我正在尝试为我的 flutter 应用程序制作聊天应用程序。但每次我尝试单击聊天时总是会出现此错误。错误 有人可以告诉我我的代码有什么问题吗?
readLocal() async {
prefs = await SharedPreferences.getInstance();
id = prefs.getString('id') ?? '';
if (id.hashCode <= peerId.hashCode) {
groupChatId = '$id-$peerId';
} else {
groupChatId = '$peerId-$id';
}
FirebaseFirestore.instance
.collection('users')
.doc(id)
.update({'chattingWith': peerId});
setState(() {});
Run Code Online (Sandbox Code Playgroud)
}