Browse Source

chat add conversation ,database query change userId to conversationId

wr_202303
zsw 4 months ago
parent
commit
a4206f9b9d
  1. 12
      lib/im/chat_details_page.dart

12
lib/im/chat_details_page.dart

@ -124,7 +124,8 @@ class _ChatDetailsPage extends State<ChatDetailsPage>
Future messageShowTime() async { Future messageShowTime() async {
List<Message> messagePages = await hxDatabase.queryTList(conversation); List<Message> messagePages = await hxDatabase.queryTList(conversation);
for (var value in messages) { for (var value in messages) {
Message message = messagePages.firstWhere((element) => value.id == element.id, orElse: () => null); Message message = messagePages
.firstWhere((element) => value.id == element.id, orElse: () => null);
value.showTime = message != null; value.showTime = message != null;
} }
} }
@ -142,8 +143,10 @@ class _ChatDetailsPage extends State<ChatDetailsPage>
} }
} }
if (apiService == null) if (apiService == null)
apiService = ApiService(Dio(), context: context, token: value.getString("token")); apiService =
BaseData<UserInfo> baseData = await apiService.queryInfo().catchError((onError) {}); ApiService(Dio(), context: context, token: value.getString("token"));
BaseData<UserInfo> baseData =
await apiService.queryInfo().catchError((onError) {});
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
setState(() { setState(() {
userInfo = baseData.data; userInfo = baseData.data;
@ -1215,8 +1218,7 @@ class _ChatDetailsPage extends State<ChatDetailsPage>
) )
], ],
), ),
) ));
);
}); });
} }

Loading…
Cancel
Save