commit
951dc60267
@ -1,19 +1,21 @@
|
||||
import 'package:flutter_openim_sdk/flutter_openim_sdk.dart';
|
||||
|
||||
class FriendshipListener {
|
||||
void onBlackListAdd(dynamic u) {}
|
||||
void onBlackListAdd(UserInfo u) {}
|
||||
|
||||
void onBlackListDeleted(dynamic u) {}
|
||||
void onBlackListDeleted(UserInfo u) {}
|
||||
|
||||
void onFriendApplicationListAccept(dynamic u) {}
|
||||
void onFriendApplicationListAccept(UserInfo u) {}
|
||||
|
||||
void onFriendApplicationListAdded(dynamic u) {}
|
||||
void onFriendApplicationListAdded(UserInfo u) {}
|
||||
|
||||
void onFriendApplicationListDeleted(dynamic u) {}
|
||||
void onFriendApplicationListDeleted(UserInfo u) {}
|
||||
|
||||
void onFriendApplicationListReject(dynamic u) {}
|
||||
void onFriendApplicationListReject(UserInfo u) {}
|
||||
|
||||
void onFriendInfoChanged(dynamic u) {}
|
||||
void onFriendInfoChanged(UserInfo u) {}
|
||||
|
||||
void onFriendListAdded(dynamic u) {}
|
||||
void onFriendListAdded(UserInfo u) {}
|
||||
|
||||
void onFriendListDeleted(dynamic u) {}
|
||||
void onFriendListDeleted(UserInfo u) {}
|
||||
}
|
||||
|
@ -216,37 +216,38 @@ class IMManager {
|
||||
} else if (call.method == ListenerType.friendListener) {
|
||||
String type = call.arguments['type'];
|
||||
dynamic data = call.arguments['data'];
|
||||
UserInfo u = UserInfo.fromJson(_formatJson(data));
|
||||
switch (type) {
|
||||
case 'onBlackListAdd':
|
||||
friendshipManager.friendshipListener.onBlackListAdd(data);
|
||||
friendshipManager.friendshipListener.onBlackListAdd(u);
|
||||
break;
|
||||
case 'onBlackListDeleted':
|
||||
friendshipManager.friendshipListener.onBlackListDeleted(data);
|
||||
friendshipManager.friendshipListener.onBlackListDeleted(u);
|
||||
break;
|
||||
case 'onFriendApplicationListAccept':
|
||||
friendshipManager.friendshipListener
|
||||
.onFriendApplicationListAccept(data);
|
||||
.onFriendApplicationListAccept(u);
|
||||
break;
|
||||
case 'onFriendApplicationListAdded':
|
||||
friendshipManager.friendshipListener
|
||||
.onFriendApplicationListAdded(data);
|
||||
.onFriendApplicationListAdded(u);
|
||||
break;
|
||||
case 'onFriendApplicationListDeleted':
|
||||
friendshipManager.friendshipListener
|
||||
.onFriendApplicationListDeleted(data);
|
||||
.onFriendApplicationListDeleted(u);
|
||||
break;
|
||||
case 'onFriendApplicationListReject':
|
||||
friendshipManager.friendshipListener
|
||||
.onFriendApplicationListReject(data);
|
||||
.onFriendApplicationListReject(u);
|
||||
break;
|
||||
case 'onFriendInfoChanged':
|
||||
friendshipManager.friendshipListener.onFriendInfoChanged(data);
|
||||
friendshipManager.friendshipListener.onFriendInfoChanged(u);
|
||||
break;
|
||||
case 'onFriendListAdded':
|
||||
friendshipManager.friendshipListener.onFriendListAdded(data);
|
||||
friendshipManager.friendshipListener.onFriendListAdded(u);
|
||||
break;
|
||||
case 'onFriendListDeleted':
|
||||
friendshipManager.friendshipListener.onFriendListDeleted(data);
|
||||
friendshipManager.friendshipListener.onFriendListDeleted(u);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user