android late request permission;update chat UI,launch chat from UI cm

This commit is contained in:
csf
2022-04-04 14:54:00 +08:00
parent 299bd11481
commit f083816fc7
9 changed files with 236 additions and 46 deletions

View File

@@ -29,10 +29,21 @@ class ChatModel with ChangeNotifier {
int get currentID => _currentID;
ChatUser get currentUser =>
FFI.serverModel.clients[_currentID]?.chatUser ?? me;
changeCurrentID(int id){
if(_messages.containsKey(id)){
_currentID = id;
notifyListeners();
} else {
final chatUser = FFI.serverModel.clients[id]?.chatUser;
if(chatUser == null){
return debugPrint("Failed to changeCurrentID,remote user doesn't exist");
}
_messages[id] = [];
_currentID = id;
}
}