会话页面
This commit is contained in:
@@ -1,9 +1,8 @@
|
||||
import 'package:azlistview/azlistview.dart';
|
||||
import 'package:chat/models/im/contact_info_model.dart';
|
||||
import 'package:chat/models/im/search_user_model.dart';
|
||||
import 'package:chat/routes/contact_routes.dart';
|
||||
import 'package:chat/services/tim_service.dart';
|
||||
import 'package:chat/utils/im_tools.dart';
|
||||
import 'package:chat/utils/network/http.dart';
|
||||
import 'package:chat/utils/ui_tools.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
@@ -35,6 +34,7 @@ class TimFriendService extends GetxService {
|
||||
tagIndex: '@',
|
||||
icon: Icons.person_add_alt,
|
||||
color: Colors.amber,
|
||||
route: ContactRoutes.friendRequest,
|
||||
),
|
||||
ContactInfoModel(
|
||||
name: '群聊',
|
||||
@@ -42,6 +42,7 @@ class TimFriendService extends GetxService {
|
||||
tagIndex: '@',
|
||||
icon: Icons.group,
|
||||
color: Colors.green,
|
||||
route: ContactRoutes.group,
|
||||
),
|
||||
ContactInfoModel(
|
||||
name: '订阅消息',
|
||||
@@ -243,25 +244,4 @@ class TimFriendService extends GetxService {
|
||||
UiTools.toast(result.desc);
|
||||
return false;
|
||||
}
|
||||
|
||||
/// 从服务器查找用户
|
||||
Future<List<SearchUserModel>?> searchUser(String keyword) async {
|
||||
try {
|
||||
var json = await Http.get(
|
||||
'user/search',
|
||||
params: {
|
||||
'keyword': keyword,
|
||||
},
|
||||
);
|
||||
|
||||
return List<SearchUserModel>.from(
|
||||
json.map(
|
||||
(x) => SearchUserModel.fromJson(x),
|
||||
),
|
||||
);
|
||||
} catch (err) {
|
||||
UiTools.toast(err.toString());
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user