parent
53ab2d6356
commit
93b39c5d22
@ -0,0 +1,28 @@ |
|||||||
|
import 'package:flutter_openim_sdk/flutter_openim_sdk.dart'; |
||||||
|
|
||||||
|
class OnAdvancedMsgListener extends AdvancedMsgListener { |
||||||
|
Function(List<HaveReadInfo> list)? recvC2CReadReceipt; |
||||||
|
Function(String msgId)? recvMessageRevoked; |
||||||
|
Function(Message msg)? recvNewMessage; |
||||||
|
|
||||||
|
OnAdvancedMsgListener({ |
||||||
|
this.recvC2CReadReceipt, |
||||||
|
this.recvMessageRevoked, |
||||||
|
this.recvNewMessage, |
||||||
|
}); |
||||||
|
|
||||||
|
@override |
||||||
|
void onRecvC2CReadReceipt(List<HaveReadInfo> list) { |
||||||
|
if (null != recvC2CReadReceipt) recvC2CReadReceipt!(list); |
||||||
|
} |
||||||
|
|
||||||
|
@override |
||||||
|
void onRecvMessageRevoked(String msgId) { |
||||||
|
if (null != recvMessageRevoked) recvMessageRevoked!(msgId); |
||||||
|
} |
||||||
|
|
||||||
|
@override |
||||||
|
void onRecvNewMessage(Message msg) { |
||||||
|
if (null != recvNewMessage) recvNewMessage!(msg); |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,49 @@ |
|||||||
|
import 'package:flutter_openim_sdk/flutter_openim_sdk.dart'; |
||||||
|
|
||||||
|
class OnConversationListener implements ConversationListener { |
||||||
|
Function(List<ConversationInfo> list)? conversationChanged; |
||||||
|
Function(List<ConversationInfo> list)? newConversation; |
||||||
|
Function(int count)? totalUnreadMsgCountChanged; |
||||||
|
Function()? syncServerFailed; |
||||||
|
Function()? syncServerFinish; |
||||||
|
Function()? syncServerStart; |
||||||
|
|
||||||
|
OnConversationListener({ |
||||||
|
this.conversationChanged, |
||||||
|
this.newConversation, |
||||||
|
this.totalUnreadMsgCountChanged, |
||||||
|
this.syncServerFailed, |
||||||
|
this.syncServerFinish, |
||||||
|
this.syncServerStart, |
||||||
|
}); |
||||||
|
|
||||||
|
@override |
||||||
|
void onConversationChanged(List<ConversationInfo> list) { |
||||||
|
if (conversationChanged != null) conversationChanged!(list); |
||||||
|
} |
||||||
|
|
||||||
|
@override |
||||||
|
void onNewConversation(List<ConversationInfo> list) { |
||||||
|
if (newConversation != null) newConversation!(list); |
||||||
|
} |
||||||
|
|
||||||
|
@override |
||||||
|
void onSyncServerFailed() { |
||||||
|
if (syncServerFailed != null) syncServerFailed!(); |
||||||
|
} |
||||||
|
|
||||||
|
@override |
||||||
|
void onSyncServerFinish() { |
||||||
|
if (syncServerFinish != null) syncServerFinish!(); |
||||||
|
} |
||||||
|
|
||||||
|
@override |
||||||
|
void onSyncServerStart() { |
||||||
|
if (syncServerStart != null) syncServerStart!(); |
||||||
|
} |
||||||
|
|
||||||
|
@override |
||||||
|
void onTotalUnreadMessageCountChanged(int i) { |
||||||
|
if (totalUnreadMsgCountChanged != null) totalUnreadMsgCountChanged!(i); |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,70 @@ |
|||||||
|
import 'package:flutter_openim_sdk/flutter_openim_sdk.dart'; |
||||||
|
|
||||||
|
class OnFriendshipListener implements FriendshipListener { |
||||||
|
Function(UserInfo u)? blackListAdd; |
||||||
|
Function(UserInfo u)? blackListDeleted; |
||||||
|
Function(UserInfo u)? friendApplicationListAccept; |
||||||
|
Function(UserInfo u)? friendApplicationListAdded; |
||||||
|
Function(UserInfo u)? friendApplicationListDeleted; |
||||||
|
Function(UserInfo u)? friendApplicationListReject; |
||||||
|
Function(UserInfo u)? friendInfoChanged; |
||||||
|
Function(UserInfo u)? friendListAdded; |
||||||
|
Function(UserInfo u)? friendListDeleted; |
||||||
|
|
||||||
|
OnFriendshipListener({ |
||||||
|
this.blackListAdd, |
||||||
|
this.blackListDeleted, |
||||||
|
this.friendApplicationListAccept, |
||||||
|
this.friendApplicationListAdded, |
||||||
|
this.friendApplicationListDeleted, |
||||||
|
this.friendApplicationListReject, |
||||||
|
this.friendInfoChanged, |
||||||
|
this.friendListAdded, |
||||||
|
this.friendListDeleted, |
||||||
|
}); |
||||||
|
|
||||||
|
@override |
||||||
|
void onBlackListAdd(UserInfo u) { |
||||||
|
if (null != blackListAdd) blackListAdd!(u); |
||||||
|
} |
||||||
|
|
||||||
|
@override |
||||||
|
void onBlackListDeleted(UserInfo u) { |
||||||
|
if (null != blackListDeleted) blackListDeleted!(u); |
||||||
|
} |
||||||
|
|
||||||
|
@override |
||||||
|
void onFriendApplicationListAccept(UserInfo u) { |
||||||
|
if (null != friendApplicationListAccept) friendApplicationListAccept!(u); |
||||||
|
} |
||||||
|
|
||||||
|
@override |
||||||
|
void onFriendApplicationListAdded(UserInfo u) { |
||||||
|
if (null != friendApplicationListAdded) friendApplicationListAdded!(u); |
||||||
|
} |
||||||
|
|
||||||
|
@override |
||||||
|
void onFriendApplicationListDeleted(UserInfo u) { |
||||||
|
if (null != friendApplicationListDeleted) friendApplicationListDeleted!(u); |
||||||
|
} |
||||||
|
|
||||||
|
@override |
||||||
|
void onFriendApplicationListReject(UserInfo u) { |
||||||
|
if (null != friendApplicationListReject) friendApplicationListReject!(u); |
||||||
|
} |
||||||
|
|
||||||
|
@override |
||||||
|
void onFriendInfoChanged(UserInfo u) { |
||||||
|
if (null != friendInfoChanged) friendInfoChanged!(u); |
||||||
|
} |
||||||
|
|
||||||
|
@override |
||||||
|
void onFriendListAdded(UserInfo u) { |
||||||
|
if (null != friendListAdded) friendListAdded!(u); |
||||||
|
} |
||||||
|
|
||||||
|
@override |
||||||
|
void onFriendListDeleted(UserInfo u) { |
||||||
|
if (null != friendListDeleted) friendListDeleted!(u); |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,75 @@ |
|||||||
|
import 'package:flutter_openim_sdk/flutter_openim_sdk.dart'; |
||||||
|
|
||||||
|
class OnGroupListener implements GroupListener { |
||||||
|
Function(String groupId, GroupMembersInfo opUser, int agreeOrReject, |
||||||
|
String opReason)? applicationProcessed; |
||||||
|
Function(String groupId)? groupCreated; |
||||||
|
Function(String groupId, GroupInfo info)? groupInfoChanged; |
||||||
|
Function(String groupId, List<GroupMembersInfo> list)? memberEnter; |
||||||
|
Function( |
||||||
|
String groupId, GroupMembersInfo opUser, List<GroupMembersInfo> list)? |
||||||
|
memberInvited; |
||||||
|
Function( |
||||||
|
String groupId, GroupMembersInfo opUser, List<GroupMembersInfo> list)? |
||||||
|
memberKicked; |
||||||
|
Function(String groupId, GroupMembersInfo info)? memberLeave; |
||||||
|
Function(String groupId, GroupMembersInfo info, String opReason)? |
||||||
|
receiveJoinApplication; |
||||||
|
|
||||||
|
OnGroupListener({ |
||||||
|
this.applicationProcessed, |
||||||
|
this.groupCreated, |
||||||
|
this.groupInfoChanged, |
||||||
|
this.memberEnter, |
||||||
|
this.memberInvited, |
||||||
|
this.memberKicked, |
||||||
|
this.memberLeave, |
||||||
|
this.receiveJoinApplication, |
||||||
|
}); |
||||||
|
|
||||||
|
@override |
||||||
|
void onApplicationProcessed(String groupId, GroupMembersInfo opUser, |
||||||
|
int agreeOrReject, String opReason) { |
||||||
|
if (null != applicationProcessed) |
||||||
|
applicationProcessed!(groupId, opUser, agreeOrReject, opReason); |
||||||
|
} |
||||||
|
|
||||||
|
@override |
||||||
|
void onGroupCreated(String groupId) { |
||||||
|
if (null != groupCreated) groupCreated!(groupId); |
||||||
|
} |
||||||
|
|
||||||
|
@override |
||||||
|
void onGroupInfoChanged(String groupId, GroupInfo info) { |
||||||
|
if (null != groupInfoChanged) groupInfoChanged!(groupId, info); |
||||||
|
} |
||||||
|
|
||||||
|
@override |
||||||
|
void onMemberEnter(String groupId, List<GroupMembersInfo> list) { |
||||||
|
if (null != memberEnter) memberEnter!(groupId, list); |
||||||
|
} |
||||||
|
|
||||||
|
@override |
||||||
|
void onMemberInvited( |
||||||
|
String groupId, GroupMembersInfo opUser, List<GroupMembersInfo> list) { |
||||||
|
if (null != memberInvited) memberInvited!(groupId, opUser, list); |
||||||
|
} |
||||||
|
|
||||||
|
@override |
||||||
|
void onMemberKicked( |
||||||
|
String groupId, GroupMembersInfo opUser, List<GroupMembersInfo> list) { |
||||||
|
if (null != memberKicked) memberKicked!(groupId, opUser, list); |
||||||
|
} |
||||||
|
|
||||||
|
@override |
||||||
|
void onMemberLeave(String groupId, GroupMembersInfo info) { |
||||||
|
if (null != memberLeave) memberLeave!(groupId, info); |
||||||
|
} |
||||||
|
|
||||||
|
@override |
||||||
|
void onReceiveJoinApplication( |
||||||
|
String groupId, GroupMembersInfo info, String opReason) { |
||||||
|
if (null != receiveJoinApplication) |
||||||
|
receiveJoinApplication!(groupId, info, opReason); |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,49 @@ |
|||||||
|
import 'package:flutter_openim_sdk/flutter_openim_sdk.dart'; |
||||||
|
|
||||||
|
class OnInitSDKListener implements InitSDKListener { |
||||||
|
Function(int? code, String? errorMsg)? connectFailed; |
||||||
|
Function()? connectSuccess; |
||||||
|
Function()? connecting; |
||||||
|
Function()? kickedOffline; |
||||||
|
Function(UserInfo info)? selfInfoUpdated; |
||||||
|
Function()? userSigExpired; |
||||||
|
|
||||||
|
OnInitSDKListener({ |
||||||
|
this.connectFailed, |
||||||
|
this.connectSuccess, |
||||||
|
this.connecting, |
||||||
|
this.kickedOffline, |
||||||
|
this.selfInfoUpdated, |
||||||
|
this.userSigExpired, |
||||||
|
}); |
||||||
|
|
||||||
|
@override |
||||||
|
void onConnectFailed(int? code, String? errorMsg) { |
||||||
|
if (null != connectFailed) connectFailed!(code, errorMsg); |
||||||
|
} |
||||||
|
|
||||||
|
@override |
||||||
|
void onConnectSuccess() { |
||||||
|
if (null != connectSuccess) connectSuccess!(); |
||||||
|
} |
||||||
|
|
||||||
|
@override |
||||||
|
void onConnecting() { |
||||||
|
if (null != connecting) connecting!.call(); |
||||||
|
} |
||||||
|
|
||||||
|
@override |
||||||
|
void onKickedOffline() { |
||||||
|
if (null != kickedOffline) kickedOffline!(); |
||||||
|
} |
||||||
|
|
||||||
|
@override |
||||||
|
void onSelfInfoUpdated(UserInfo info) { |
||||||
|
if (null != selfInfoUpdated) selfInfoUpdated!(info); |
||||||
|
} |
||||||
|
|
||||||
|
@override |
||||||
|
void onUserSigExpired() { |
||||||
|
if (null != userSigExpired) userSigExpired!(); |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,11 @@ |
|||||||
|
import 'package:flutter_openim_sdk/flutter_openim_sdk.dart'; |
||||||
|
|
||||||
|
class OnMsgSendProgressListener implements MsgSendProgressListener { |
||||||
|
Function(String msgID, int progress)? progressCallback; |
||||||
|
|
||||||
|
OnMsgSendProgressListener({this.progressCallback}); |
||||||
|
|
||||||
|
void onProgress(String msgID, int progress) { |
||||||
|
if (null != progressCallback) progressCallback!(msgID, progress); |
||||||
|
} |
||||||
|
} |
Loading…
Reference in new issue