Browse Source

发消息修改

wr_202303
zsw 4 months ago
parent
commit
6ea93117e3
  1. 1
      lib/im/database/hx_database.dart
  2. 17
      lib/im/im_view/im_page.dart

1
lib/im/database/hx_database.dart

@ -1,4 +1,5 @@
import 'package:flutter/cupertino.dart';
import 'package:huixiang/constant.dart';
import 'package:huixiang/im/database/message.dart';
import 'package:huixiang/im/database/migration.dart';
import 'package:sqflite/sqflite.dart';

17
lib/im/im_view/im_page.dart

@ -232,6 +232,9 @@ class _IMPage extends State<IMPage> implements OnChatMessage {
///
queryMemberInfo(List<String> mids) async {
if (mids.isEmpty) {
return;
}
BaseData<List<ImUserList>> baseData = await apiService.memberInfoByIds({
"mids": mids,
}).catchError((error) {
@ -239,17 +242,19 @@ class _IMPage extends State<IMPage> implements OnChatMessage {
alignment: Alignment.center);
});
if (baseData != null && baseData.isSuccess) {
baseData.data.forEach((element) async {
await hxDatabase.insertOrUpdateImUser(element.toJson());
});
contactMap = baseData.data.lGroupBy((p0) => p0.mid).mGroupItem;
setState(() {});
if (baseData.data.isNotEmpty) {
baseData.data.forEach((element) async {
await hxDatabase.insertOrUpdateImUser(element.toJson());
});
contactMap = baseData.data.lGroupBy((p0) => p0.mid).mGroupItem;
setState(() {});
}
} else {
SmartDialog.showToast(baseData.msg, alignment: Alignment.center);
}
}
RefreshController _refreshController = RefreshController();
final RefreshController _refreshController = RefreshController();
@override
Widget build(BuildContext context) {

Loading…
Cancel
Save