Merge commit '0a175bb8b1eb8d4a40c66107ca77a2ff33212bf9' into pre_merge

# Conflicts:
#	.idea/libraries/Dart_SDK.xml
#	android/build.gradle
#	android/gradle/wrapper/gradle-wrapper.properties
#	android/src/main/AndroidManifest.xml
#	example/android/app/build.gradle
#	example/android/build.gradle
#	example/android/settings.gradle
#	example/lib/main.dart
#	example/pubspec.lock
#	ios/flutter_openim_sdk.podspec
#	lib/src/manager/im_conversation_manager.dart
#	lib/src/manager/im_friendship_manager.dart
#	lib/src/models/notification_info.dart
This commit is contained in:
gem
2025-12-10 18:13:02 +08:00
41 changed files with 2049 additions and 342 deletions

View File

@@ -50,22 +50,36 @@ class FriendshipManager {
}));
/// Get Friend Requests Sent to Me
Future<List<FriendApplicationInfo>> getFriendApplicationListAsRecipient({String? operationID}) => _channel
.invokeMethod(
'getFriendApplicationListAsRecipient',
_buildParam({
"operationID": Utils.checkOperationID(operationID),
}))
.then((value) => Utils.toList(value, (v) => FriendApplicationInfo.fromJson(v)));
Future<List<FriendApplicationInfo>> getFriendApplicationListAsRecipient(
{GetFriendApplicationListAsRecipientReq? req, String? operationID}) {
if (req != null && req.offset > 0) {
assert(req.count > 0, 'count must be greater than 0');
}
return _channel
.invokeMethod(
'getFriendApplicationListAsRecipient',
_buildParam({
'req': req?.toJson() ?? {},
"operationID": Utils.checkOperationID(operationID),
}))
.then((value) => Utils.toList(value, (v) => FriendApplicationInfo.fromJson(v)));
}
/// Get Friend Requests Sent by Me
Future<List<FriendApplicationInfo>> getFriendApplicationListAsApplicant({String? operationID}) => _channel
.invokeMethod(
'getFriendApplicationListAsApplicant',
_buildParam({
"operationID": Utils.checkOperationID(operationID),
}))
.then((value) => Utils.toList(value, (v) => FriendApplicationInfo.fromJson(v)));
Future<List<FriendApplicationInfo>> getFriendApplicationListAsApplicant(
{GetFriendApplicationListAsApplicantReq? req, String? operationID}) {
if (req != null && req.offset > 0) {
assert(req.count > 0, 'count must be greater than 0');
}
return _channel
.invokeMethod(
'getFriendApplicationListAsApplicant',
_buildParam({
'req': req?.toJson() ?? {},
"operationID": Utils.checkOperationID(operationID),
}))
.then((value) => Utils.toList(value, (v) => FriendApplicationInfo.fromJson(v)));
}
/// Get Friend List, including friends who have been put into the blacklist
Future<List<FriendInfo>> getFriendList({
@@ -286,6 +300,17 @@ class FriendshipManager {
.then((value) => value);
}
Future<int> getFriendApplicationUnhandledCount(GetFriendApplicationUnhandledCountReq req,
{String? operationID}) =>
_channel
.invokeMethod(
'getFriendApplicationUnhandledCount',
_buildParam({
'req': req.toJson(),
'operationID': Utils.checkOperationID(operationID),
}))
.then((value) => int.parse(value));
static Map _buildParam(Map<String, dynamic> param) {
param["ManagerName"] = "friendshipManager";
param = Utils.cleanMap(param);

View File

@@ -18,43 +18,39 @@ class GroupManager {
/// Invite users to a group, allowing them to join without approval.
/// [groupID] Group ID
/// [userIDList] List of user IDs
Future<List<GroupInviteResult>> inviteUserToGroup({
Future inviteUserToGroup({
required String groupID,
required List<String> userIDList,
String? reason,
String? operationID,
}) =>
_channel
.invokeMethod(
'inviteUserToGroup',
_buildParam({
'groupID': groupID,
'userIDList': userIDList,
'reason': reason,
"operationID": Utils.checkOperationID(operationID),
}))
.then((value) => Utils.toList(value, (map) => GroupInviteResult.fromJson(map)));
_channel.invokeMethod(
'inviteUserToGroup',
_buildParam({
'groupID': groupID,
'userIDList': userIDList,
'reason': reason,
"operationID": Utils.checkOperationID(operationID),
}));
/// Remove group members
/// [groupID] Group ID
/// [userIDList] List of user IDs
/// [reason] Reason for removal
Future<List<GroupInviteResult>> kickGroupMember({
Future kickGroupMember({
required String groupID,
required List<String> userIDList,
String? reason,
String? operationID,
}) =>
_channel
.invokeMethod(
'kickGroupMember',
_buildParam({
'groupID': groupID,
'userIDList': userIDList,
'reason': reason,
"operationID": Utils.checkOperationID(operationID),
}))
.then((value) => Utils.toList(value, (map) => GroupInviteResult.fromJson(map)));
_channel.invokeMethod(
'kickGroupMember',
_buildParam({
'groupID': groupID,
'userIDList': userIDList,
'reason': reason,
"operationID": Utils.checkOperationID(operationID),
}));
/// Query group member information
/// [groupID] Group ID
@@ -131,15 +127,17 @@ class GroupManager {
}))
.then((value) => Utils.toList(value, (map) => GroupInfo.fromJson(map)));
Future<List<GroupInfo>> getJoinedGroupListPage({String? operationID, int offset = 0, int count = 40}) => _channel
.invokeMethod(
'getJoinedGroupListPage',
_buildParam({
'offset': offset,
'count': count,
'operationID': Utils.checkOperationID(operationID),
}))
.then((value) => Utils.toList(value, (map) => GroupInfo.fromJson(map)));
Future<List<GroupInfo>> getJoinedGroupListPage(
{String? operationID, int offset = 0, int count = 40}) =>
_channel
.invokeMethod(
'getJoinedGroupListPage',
_buildParam({
'offset': offset,
'count': count,
'operationID': Utils.checkOperationID(operationID),
}))
.then((value) => Utils.toList(value, (map) => GroupInfo.fromJson(map)));
/// Query the list of joined groups
Future<List<dynamic>> getJoinedGroupListMap({String? operationID}) => _channel
@@ -218,7 +216,11 @@ class GroupManager {
/// Apply to join a group, requiring approval from an administrator or the group.
/// [joinSource] 2: Invited, 3: Searched, 4: Using a QR code
Future<dynamic> joinGroup(
{required String groupID, String? reason, String? operationID, int joinSource = 3, String? ex}) =>
{required String groupID,
String? reason,
String? operationID,
int joinSource = 3,
String? ex}) =>
_channel.invokeMethod(
'joinGroup',
_buildParam({
@@ -258,22 +260,41 @@ class GroupManager {
}));
/// Handle group membership applications received as a group owner or administrator
Future<List<GroupApplicationInfo>> getGroupApplicationListAsRecipient({String? operationID}) => _channel
.invokeMethod(
'getGroupApplicationListAsRecipient',
_buildParam({
'operationID': Utils.checkOperationID(operationID),
}))
.then((value) => Utils.toList(value, (map) => GroupApplicationInfo.fromJson(map)));
Future<List<GroupApplicationInfo>> getGroupApplicationListAsRecipient({
GetGroupApplicationListAsRecipientReq? req,
String? operationID,
}) {
if (req != null && req.offset > 0) {
assert(req.count > 0, 'count must be greater than 0');
}
return _channel
.invokeMethod(
'getGroupApplicationListAsRecipient',
_buildParam({
'req': req?.toJson() ?? {},
"operationID": Utils.checkOperationID(operationID),
}))
.then((value) => Utils.toList(value, (map) => GroupApplicationInfo.fromJson(map)));
}
/// Get the list of group membership applications sent by the user
Future<List<GroupApplicationInfo>> getGroupApplicationListAsApplicant({String? operationID}) => _channel
.invokeMethod(
'getGroupApplicationListAsApplicant',
_buildParam({
'operationID': Utils.checkOperationID(operationID),
}))
.then((value) => Utils.toList(value, (map) => GroupApplicationInfo.fromJson(map)));
Future<List<GroupApplicationInfo>> getGroupApplicationListAsApplicant({
GetGroupApplicationListAsApplicantReq? req,
String? operationID,
}) {
if (req != null && req.offset > 0) {
assert(req.count > 0, 'count must be greater than 0');
}
return _channel
.invokeMethod(
'getGroupApplicationListAsApplicant',
_buildParam({
'req': req?.toJson() ?? {},
"operationID": Utils.checkOperationID(operationID),
}))
.then((value) => Utils.toList(value, (map) => GroupApplicationInfo.fromJson(map)));
}
/// Accept a group membership application as an administrator or group owner
/// Note: Membership applications require approval from administrators or the group.
@@ -584,13 +605,22 @@ class GroupManager {
'operationID': Utils.checkOperationID(operationID),
}));
Future<int> getGroupApplicationUnhandledCount(GetGroupApplicationUnhandledCountReq req,
{String? operationID}) =>
_channel
.invokeMethod(
'getGroupApplicationUnhandledCount',
_buildParam({
'req': req.toJson(),
'operationID': Utils.checkOperationID(operationID),
}))
.then((value) => int.parse(value));
static Map _buildParam(Map<String, dynamic> param) {
param["ManagerName"] = "groupManager";
param = Utils.cleanMap(param);
log('param: $param');
return param;
}
}

View File

@@ -481,8 +481,8 @@ class IMManager {
}
/// Deinitialize the SDK
Future<dynamic> unInitSDK() {
return _channel.invokeMethod('unInitSDK', _buildParam({}));
void unInitSDK() {
_channel.invokeMethod('unInitSDK', _buildParam({}));
}
/// Login

View File

@@ -422,3 +422,90 @@ class GroupInviteResult {
return data;
}
}
class GetGroupApplicationListAsRecipientReq {
final List<String> groupIDs;
final List<int> handleResults;
final int offset;
final int count;
GetGroupApplicationListAsRecipientReq({
this.groupIDs = const [],
this.handleResults = const [],
required this.offset,
required this.count,
});
GetGroupApplicationListAsRecipientReq.fromJson(Map<String, dynamic> json)
: groupIDs = json['groupIDs'] == null ? [] : List<String>.from(json['groupIDs'].map((x) => x)),
handleResults = json['handleResults'] == null ? [] : List<int>.from(json['handleResults'].map((x) => x)),
offset = json['offset'],
count = json['count'];
Map<String, dynamic> toJson() {
final data = <String, dynamic>{};
data['groupIDs'] = groupIDs;
data['handleResults'] = handleResults;
data['offset'] = offset;
data['count'] = count;
return data;
}
@override
String toString() {
return 'GetGroupApplicationListAsRecipientReq{groupIDs: $groupIDs, handleResults: $handleResults, offset: $offset, count: $count}';
}
}
class GetGroupApplicationListAsApplicantReq {
final List<String> groupIDs;
final List<int> handleResults;
final int offset;
final int count;
GetGroupApplicationListAsApplicantReq({
this.groupIDs = const [],
this.handleResults = const [],
required this.offset,
required this.count,
});
GetGroupApplicationListAsApplicantReq.fromJson(Map<String, dynamic> json)
: groupIDs = json['groupIDs'] == null ? [] : List<String>.from(json['groupIDs'].map((x) => x)),
handleResults = json['handleResults'] == null ? [] : List<int>.from(json['handleResults'].map((x) => x)),
offset = json['offset'],
count = json['count'];
Map<String, dynamic> toJson() {
final data = <String, dynamic>{};
data['groupIDs'] = groupIDs;
data['handleResults'] = handleResults;
data['offset'] = offset;
data['count'] = count;
return data;
}
@override
String toString() {
return 'GetGroupApplicationListAsApplicantReq{groupIDs: $groupIDs, handleResults: $handleResults, offset: $offset, count: $count}';
}
}
class GetGroupApplicationUnhandledCountReq {
final int time;
GetGroupApplicationUnhandledCountReq({this.time = 0});
GetGroupApplicationUnhandledCountReq.fromJson(Map<String, dynamic> json) : time = json['time'];
Map<String, dynamic> toJson() {
final data = <String, dynamic>{};
data['time'] = time;
return data;
}
@override
String toString() {
return 'GetGroupApplicationUnhandledCountReq{time: $time}';
}
}

View File

@@ -1,6 +1,6 @@
import '../../flutter_openim_sdk.dart';
/// OA notification
/// OA Notification
class OANotification {
/// Title
String? notificationName;
@@ -58,57 +58,50 @@ class OANotification {
text = json['text'];
externalUrl = json['externalUrl'];
mixType = json['mixType'];
pictureElem = json['pictureElem'] != null
? PictureElem.fromJson(json['pictureElem'])
: null;
soundElem = json['soundElem'] != null
? SoundElem.fromJson(json['soundElem'])
: null;
videoElem = json['videoElem'] != null
? VideoElem.fromJson(json['videoElem'])
: null;
fileElem =
json['fileElem'] != null ? FileElem.fromJson(json['fileElem']) : null;
pictureElem = json['pictureElem'] != null ? PictureElem.fromJson(json['pictureElem']) : null;
soundElem = json['soundElem'] != null ? SoundElem.fromJson(json['soundElem']) : null;
videoElem = json['videoElem'] != null ? VideoElem.fromJson(json['videoElem']) : null;
fileElem = json['fileElem'] != null ? FileElem.fromJson(json['fileElem']) : null;
ex = json['ex'];
}
Map<String, dynamic> toJson() {
final data = Map<String, dynamic>();
data['notificationName'] = this.notificationName;
data['notificationFaceURL'] = this.notificationFaceURL;
data['notificationType'] = this.notificationType;
data['text'] = this.text;
data['externalUrl'] = this.externalUrl;
data['mixType'] = this.mixType;
if (this.pictureElem != null) {
data['pictureElem'] = this.pictureElem!.toJson();
data['notificationName'] = notificationName;
data['notificationFaceURL'] = notificationFaceURL;
data['notificationType'] = notificationType;
data['text'] = text;
data['externalUrl'] = externalUrl;
data['mixType'] = mixType;
if (pictureElem != null) {
data['pictureElem'] = pictureElem!.toJson();
}
if (this.soundElem != null) {
data['soundElem'] = this.soundElem!.toJson();
if (soundElem != null) {
data['soundElem'] = soundElem!.toJson();
}
if (this.videoElem != null) {
data['videoElem'] = this.videoElem!.toJson();
if (videoElem != null) {
data['videoElem'] = videoElem!.toJson();
}
if (this.fileElem != null) {
data['fileElem'] = this.fileElem!.toJson();
if (fileElem != null) {
data['fileElem'] = fileElem!.toJson();
}
data['ex'] = this.ex;
data['ex'] = ex;
return data;
}
}
/// 群事件通知
/// Group Event Notification
class GroupNotification {
/// 群信息
/// Group information
GroupInfo? group;
/// 当前事件操作者信息
/// Current event operator information
GroupMembersInfo? opUser;
/// 群拥有者信息
/// Group owner information
GroupMembersInfo? groupOwnerUser;
/// 产生影响的群成员列表
/// List of affected group members
List<GroupMembersInfo>? memberList;
GroupNotification({
@@ -120,12 +113,8 @@ class GroupNotification {
GroupNotification.fromJson(Map<String, dynamic> json) {
group = json['group'] != null ? GroupInfo.fromJson(json['group']) : null;
opUser = json['opUser'] != null
? GroupMembersInfo.fromJson(json['opUser'])
: null;
groupOwnerUser = json['groupOwnerUser'] != null
? GroupMembersInfo.fromJson(json['groupOwnerUser'])
: null;
opUser = json['opUser'] != null ? GroupMembersInfo.fromJson(json['opUser']) : null;
groupOwnerUser = json['groupOwnerUser'] != null ? GroupMembersInfo.fromJson(json['groupOwnerUser']) : null;
if (json['memberList'] != null) {
memberList = <GroupMembersInfo>[];
json['memberList'].forEach((v) {
@@ -136,40 +125,42 @@ class GroupNotification {
Map<String, dynamic> toJson() {
final data = Map<String, dynamic>();
if (this.group != null) {
data['group'] = this.group!.toJson();
if (group != null) {
data['group'] = group!.toJson();
}
if (this.opUser != null) {
data['opUser'] = this.opUser!.toJson();
if (opUser != null) {
data['opUser'] = opUser!.toJson();
}
if (this.groupOwnerUser != null) {
data['groupOwnerUser'] = this.groupOwnerUser!.toJson();
if (groupOwnerUser != null) {
data['groupOwnerUser'] = groupOwnerUser!.toJson();
}
if (this.memberList != null) {
data['memberList'] = this.memberList!.map((v) => v.toJson()).toList();
if (memberList != null) {
data['memberList'] = memberList!.map((v) => v.toJson()).toList();
}
return data;
}
}
/// 用户被邀请进群通知
/// User Invited to Join Group Notification
class InvitedJoinGroupNotification {
/// 群信息
/// Group information
GroupInfo? group;
/// 操作者信息
/// Operator information
GroupMembersInfo? opUser;
/// 被邀请进群的成员信息
/// Inviter information
GroupMembersInfo? inviterUser;
/// List of members invited to join the group
List<GroupMembersInfo>? invitedUserList;
InvitedJoinGroupNotification({this.group, this.opUser, this.invitedUserList});
InvitedJoinGroupNotification.fromJson(Map<String, dynamic> json) {
group = json['group'] != null ? GroupInfo.fromJson(json['group']) : null;
opUser = json['opUser'] != null
? GroupMembersInfo.fromJson(json['opUser'])
: null;
opUser = json['opUser'] != null ? GroupMembersInfo.fromJson(json['opUser']) : null;
inviterUser = json['inviterUser'] != null ? GroupMembersInfo.fromJson(json['inviterUser']) : null;
if (json['invitedUserList'] != null) {
invitedUserList = <GroupMembersInfo>[];
json['invitedUserList'].forEach((v) {
@@ -179,40 +170,39 @@ class InvitedJoinGroupNotification {
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
if (this.group != null) {
data['group'] = this.group!.toJson();
final Map<String, dynamic> data = <String, dynamic>{};
if (group != null) {
data['group'] = group!.toJson();
}
if (this.opUser != null) {
data['opUser'] = this.opUser!.toJson();
if (opUser != null) {
data['opUser'] = opUser!.toJson();
}
if (this.invitedUserList != null) {
data['invitedUserList'] =
this.invitedUserList!.map((v) => v.toJson()).toList();
if (inviterUser != null) {
data['inviterUser'] = inviterUser!.toJson();
}
if (invitedUserList != null) {
data['invitedUserList'] = invitedUserList!.map((v) => v.toJson()).toList();
}
return data;
}
}
/// 组踢出成员通知
/// Group Member Kicked Notification
class KickedGroupMemeberNotification {
/// 群信息
/// Group information
GroupInfo? group;
/// 操作者信息
/// Operator information
GroupMembersInfo? opUser;
/// 被踢出群的成员信息列表
/// List of members kicked from the group
List<GroupMembersInfo>? kickedUserList;
KickedGroupMemeberNotification(
{this.group, this.opUser, this.kickedUserList});
KickedGroupMemeberNotification({this.group, this.opUser, this.kickedUserList});
KickedGroupMemeberNotification.fromJson(Map<String, dynamic> json) {
group = json['group'] != null ? GroupInfo.fromJson(json['group']) : null;
opUser = json['opUser'] != null
? GroupMembersInfo.fromJson(json['opUser'])
: null;
opUser = json['opUser'] != null ? GroupMembersInfo.fromJson(json['opUser']) : null;
if (json['kickedUserList'] != null) {
kickedUserList = <GroupMembersInfo>[];
json['kickedUserList'].forEach((v) {
@@ -223,87 +213,82 @@ class KickedGroupMemeberNotification {
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
if (this.group != null) {
data['group'] = this.group!.toJson();
if (group != null) {
data['group'] = group!.toJson();
}
if (this.opUser != null) {
data['opUser'] = this.opUser!.toJson();
if (opUser != null) {
data['opUser'] = opUser!.toJson();
}
if (this.kickedUserList != null) {
data['kickedUserList'] =
this.kickedUserList!.map((v) => v.toJson()).toList();
if (kickedUserList != null) {
data['kickedUserList'] = kickedUserList!.map((v) => v.toJson()).toList();
}
return data;
}
}
/// 退出群通知
/// Quit Group Notification
class QuitGroupNotification {
/// 群信息
/// Group information
GroupInfo? group;
/// 退群的成员信息
/// Information of the member who quit the group
GroupMembersInfo? quitUser;
QuitGroupNotification({this.group, this.quitUser});
QuitGroupNotification.fromJson(Map<String, dynamic> json) {
group = json['group'] != null ? GroupInfo.fromJson(json['group']) : null;
quitUser = json['quitUser'] != null
? GroupMembersInfo.fromJson(json['quitUser'])
: null;
quitUser = json['quitUser'] != null ? GroupMembersInfo.fromJson(json['quitUser']) : null;
}
Map<String, dynamic> toJson() {
final data = Map<String, dynamic>();
if (this.group != null) {
data['group'] = this.group!.toJson();
if (group != null) {
data['group'] = group!.toJson();
}
if (this.quitUser != null) {
data['quitUser'] = this.quitUser!.toJson();
if (quitUser != null) {
data['quitUser'] = quitUser!.toJson();
}
return data;
}
}
/// 进群通知
/// Enter Group Notification
class EnterGroupNotification {
/// 群信息
/// Group information
GroupInfo? group;
/// 进入群的成员信息
/// Information of the member who entered the group
GroupMembersInfo? entrantUser;
EnterGroupNotification({this.group, this.entrantUser});
EnterGroupNotification.fromJson(Map<String, dynamic> json) {
group = json['group'] != null ? GroupInfo.fromJson(json['group']) : null;
entrantUser = json['entrantUser'] != null
? GroupMembersInfo.fromJson(json['entrantUser'])
: null;
entrantUser = json['entrantUser'] != null ? GroupMembersInfo.fromJson(json['entrantUser']) : null;
}
Map<String, dynamic> toJson() {
final data = Map<String, dynamic>();
if (this.group != null) {
data['group'] = this.group!.toJson();
if (group != null) {
data['group'] = group!.toJson();
}
if (this.entrantUser != null) {
data['quitUser'] = this.entrantUser!.toJson();
if (entrantUser != null) {
data['entrantUser'] = entrantUser!.toJson();
}
return data;
}
}
/// 群权转让通知
/// Group Rights Transfer Notification
class GroupRightsTransferNoticication {
/// 群信息
/// Group information
GroupInfo? group;
/// 操作者信息
/// Operator information
GroupMembersInfo? opUser;
/// 群新的拥有者信息
/// New group owner information
GroupMembersInfo? newGroupOwner;
GroupRightsTransferNoticication({
@@ -314,41 +299,37 @@ class GroupRightsTransferNoticication {
GroupRightsTransferNoticication.fromJson(Map<String, dynamic> json) {
group = json['group'] != null ? GroupInfo.fromJson(json['group']) : null;
opUser = json['opUser'] != null
? GroupMembersInfo.fromJson(json['opUser'])
: null;
newGroupOwner = json['newGroupOwner'] != null
? GroupMembersInfo.fromJson(json['newGroupOwner'])
: null;
opUser = json['opUser'] != null ? GroupMembersInfo.fromJson(json['opUser']) : null;
newGroupOwner = json['newGroupOwner'] != null ? GroupMembersInfo.fromJson(json['newGroupOwner']) : null;
}
Map<String, dynamic> toJson() {
final data = Map<String, dynamic>();
if (this.group != null) {
data['group'] = this.group!.toJson();
if (group != null) {
data['group'] = group!.toJson();
}
if (this.opUser != null) {
data['opUser'] = this.opUser!.toJson();
if (opUser != null) {
data['opUser'] = opUser!.toJson();
}
if (this.newGroupOwner != null) {
data['newGroupOwner'] = this.newGroupOwner!.toJson();
if (newGroupOwner != null) {
data['newGroupOwner'] = newGroupOwner!.toJson();
}
return data;
}
}
/// 禁言成员通知
/// Mute Member Notification
class MuteMemberNotification {
/// 群信息
/// Group information
GroupInfo? group;
/// 操作者信息
/// Operator information
GroupMembersInfo? opUser;
/// 被禁言的成员信息
/// Muted member information
GroupMembersInfo? mutedUser;
/// 禁言时间s
/// Mute duration in seconds
int? mutedSeconds;
MuteMemberNotification({
@@ -360,40 +341,36 @@ class MuteMemberNotification {
MuteMemberNotification.fromJson(Map<String, dynamic> json) {
group = json['group'] != null ? GroupInfo.fromJson(json['group']) : null;
opUser = json['opUser'] != null
? GroupMembersInfo.fromJson(json['opUser'])
: null;
mutedUser = json['mutedUser'] != null
? GroupMembersInfo.fromJson(json['mutedUser'])
: null;
opUser = json['opUser'] != null ? GroupMembersInfo.fromJson(json['opUser']) : null;
mutedUser = json['mutedUser'] != null ? GroupMembersInfo.fromJson(json['mutedUser']) : null;
mutedSeconds = json['mutedSeconds'];
}
Map<String, dynamic> toJson() {
final data = Map<String, dynamic>();
if (this.group != null) {
data['group'] = this.group!.toJson();
if (group != null) {
data['group'] = group!.toJson();
}
if (this.opUser != null) {
data['opUser'] = this.opUser!.toJson();
if (opUser != null) {
data['opUser'] = opUser!.toJson();
}
if (this.mutedUser != null) {
data['mutedUser'] = this.mutedUser!.toJson();
if (mutedUser != null) {
data['mutedUser'] = mutedUser!.toJson();
}
data['mutedSeconds'] = this.mutedSeconds;
data['mutedSeconds'] = mutedSeconds;
return data;
}
}
/// 阅后即焚通知
/// Burn After Reading Notification
class BurnAfterReadingNotification {
/// 接收者
/// Receiver
String? recvID;
/// 发送者
/// Sender
String? sendID;
/// 是否开启
/// Whether enabled
bool? isPrivate;
BurnAfterReadingNotification({this.recvID, this.sendID, this.isPrivate});
@@ -406,22 +383,22 @@ class BurnAfterReadingNotification {
Map<String, dynamic> toJson() {
final data = Map<String, dynamic>();
data['recvID'] = this.recvID;
data['sendID'] = this.sendID;
data['isPrivate'] = this.isPrivate;
data['recvID'] = recvID;
data['sendID'] = sendID;
data['isPrivate'] = isPrivate;
return data;
}
}
/// 群成员信息发送变化通知
/// Group Member Information Changed Notification
class GroupMemberInfoChangedNotification {
/// 群信息
/// Group information
GroupInfo? group;
/// 操作者信息
/// Operator information
GroupMembersInfo? opUser;
/// 资料发生改变的成员
/// Member with changed information
GroupMembersInfo? changedUser;
GroupMemberInfoChangedNotification({
@@ -432,24 +409,20 @@ class GroupMemberInfoChangedNotification {
GroupMemberInfoChangedNotification.fromJson(Map<String, dynamic> json) {
group = json['group'] != null ? GroupInfo.fromJson(json['group']) : null;
opUser = json['opUser'] != null
? GroupMembersInfo.fromJson(json['opUser'])
: null;
changedUser = json['changedUser'] != null
? GroupMembersInfo.fromJson(json['changedUser'])
: null;
opUser = json['opUser'] != null ? GroupMembersInfo.fromJson(json['opUser']) : null;
changedUser = json['changedUser'] != null ? GroupMembersInfo.fromJson(json['changedUser']) : null;
}
Map<String, dynamic> toJson() {
final data = Map<String, dynamic>();
if (this.group != null) {
data['group'] = this.group!.toJson();
if (group != null) {
data['group'] = group!.toJson();
}
if (this.opUser != null) {
data['opUser'] = this.opUser!.toJson();
if (opUser != null) {
data['opUser'] = opUser!.toJson();
}
if (this.changedUser != null) {
data['changedUser'] = this.changedUser!.toJson();
if (changedUser != null) {
data['changedUser'] = changedUser!.toJson();
}
return data;
}
@@ -707,3 +680,4 @@ class ChannelMemberInfoChangedNotification {
return data;
}
}

View File

@@ -124,6 +124,6 @@ class SearchFriendsInfo extends FriendInfo {
Map<String, dynamic> toJson() {
final data = super.toJson();
data['relationship'] = this.relationship;
return data ?? {};
return data;
}
}

View File

@@ -423,3 +423,78 @@ class UserStatusInfo {
return data;
}
}
class GetFriendApplicationListAsRecipientReq {
final List<int> handleResults;
final int offset;
final int count;
GetFriendApplicationListAsRecipientReq({
this.handleResults = const [],
required this.offset,
required this.count,
});
GetFriendApplicationListAsRecipientReq.fromJson(Map<String, dynamic> json)
: handleResults = json['handleResults'] == null ? [] : List<int>.from(json['handleResults'].map((x) => x)),
offset = json['offset'],
count = json['count'];
Map<String, dynamic> toJson() {
final data = <String, dynamic>{};
data['handleResults'] = handleResults;
data['offset'] = offset;
data['count'] = count;
return data;
}
@override
String toString() {
return 'GetFriendApplicationListAsRecipientReq{handleResults: $handleResults, offset: $offset, count: $count}';
}
}
class GetFriendApplicationListAsApplicantReq {
final int offset;
final int count;
GetFriendApplicationListAsApplicantReq({
required this.offset,
required this.count,
});
GetFriendApplicationListAsApplicantReq.fromJson(Map<String, dynamic> json)
: offset = json['offset'],
count = json['count'];
Map<String, dynamic> toJson() {
final data = <String, dynamic>{};
data['offset'] = offset;
data['count'] = count;
return data;
}
@override
String toString() {
return 'GetFriendApplicationListAsApplicantReq{offset: $offset, count: $count}';
}
}
class GetFriendApplicationUnhandledCountReq {
final int time;
GetFriendApplicationUnhandledCountReq({this.time = 0});
GetFriendApplicationUnhandledCountReq.fromJson(Map<String, dynamic> json) : time = json['time'];
Map<String, dynamic> toJson() {
final data = <String, dynamic>{};
data['time'] = time;
return data;
}
@override
String toString() {
return 'GetSelfUnhandledApplyCountReq{time: $time}';
}
}

View File

@@ -2,7 +2,7 @@ import 'package:flutter/services.dart';
import 'package:flutter_openim_sdk/flutter_openim_sdk.dart';
class OpenIM {
static const version = '3.8.3+2';
static const version = '3.8.3+hotfix.10.1';
static const _channel = MethodChannel('flutter_openim_sdk');