init
This commit is contained in:
parent
c15773e28c
commit
9ac48d065a
@ -7,11 +7,9 @@ buildscript {
|
|||||||
maven { url 'http://maven.aliyun.com/nexus/content/repositories/jcenter' }
|
maven { url 'http://maven.aliyun.com/nexus/content/repositories/jcenter' }
|
||||||
maven { url 'http://maven.aliyun.com/nexus/content/repositories/google' }
|
maven { url 'http://maven.aliyun.com/nexus/content/repositories/google' }
|
||||||
maven { url 'http://maven.aliyun.com/nexus/content/repositories/gradle-plugin' }
|
maven { url 'http://maven.aliyun.com/nexus/content/repositories/gradle-plugin' }
|
||||||
|
maven { url 'http://47.112.160.66:8081/repository/maven-releases'}
|
||||||
|
maven { url 'http://127.0.0.1:8081/repository/maven-releases' }
|
||||||
google()
|
google()
|
||||||
maven {
|
|
||||||
url 'http://47.112.160.66:8081/repository/maven-releases'
|
|
||||||
// url 'http://127.0.0.1:8081/repository/maven-releases/'
|
|
||||||
}
|
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -26,11 +24,9 @@ rootProject.allprojects {
|
|||||||
maven { url 'http://maven.aliyun.com/nexus/content/repositories/jcenter' }
|
maven { url 'http://maven.aliyun.com/nexus/content/repositories/jcenter' }
|
||||||
maven { url 'http://maven.aliyun.com/nexus/content/repositories/google' }
|
maven { url 'http://maven.aliyun.com/nexus/content/repositories/google' }
|
||||||
maven { url 'http://maven.aliyun.com/nexus/content/repositories/gradle-plugin' }
|
maven { url 'http://maven.aliyun.com/nexus/content/repositories/gradle-plugin' }
|
||||||
|
maven { url 'http://47.112.160.66:8081/repository/maven-releases'}
|
||||||
|
maven { url 'http://127.0.0.1:8081/repository/maven-releases' }
|
||||||
google()
|
google()
|
||||||
maven {
|
|
||||||
url 'http://47.112.160.66:8081/repository/maven-releases'
|
|
||||||
// url 'http://127.0.0.1:8081/repository/maven-releases'
|
|
||||||
}
|
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -49,6 +45,6 @@ android {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
dependencies {
|
dependencies {
|
||||||
// implementation 'io.openim:localsdk:1.2.9@aar'
|
implementation 'io.openim:client-sdk:0.0.1@aar'
|
||||||
implementation 'io.openim:client-sdk:1.0.0@aar'//graoupId:artifactId:version@aar
|
// implementation 'io.openim:client-sdk:1.0.0@aar'//graoupId:artifactId:version@aar
|
||||||
}
|
}
|
@ -107,4 +107,20 @@ public class GroupManager {
|
|||||||
new BaseListener(result));
|
new BaseListener(result));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void forceSyncApplyGroupRequest(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
|
Open_im_sdk.forceSyncApplyGroupRequest();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void forceSyncGroupRequest(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
|
Open_im_sdk.forceSyncGroupRequest();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void forceSyncJoinedGroup(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
|
Open_im_sdk.forceSyncJoinedGroup();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void forceSyncJoinedGroupMember(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
|
Open_im_sdk.forceSyncJoinedGroupMember();
|
||||||
|
}
|
||||||
}
|
}
|
@ -41,4 +41,8 @@ public class IMManager {
|
|||||||
public void forceSyncLoginUerInfo(MethodCall methodCall, MethodChannel.Result result) {
|
public void forceSyncLoginUerInfo(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
Open_im_sdk.forceSyncLoginUerInfo();
|
Open_im_sdk.forceSyncLoginUerInfo();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void forceReConn(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
|
Open_im_sdk.forceReConn();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -139,4 +139,8 @@ public class MessageManager {
|
|||||||
public void getTotalUnreadMsgCount(MethodCall methodCall, MethodChannel.Result result) {
|
public void getTotalUnreadMsgCount(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
Open_im_sdk.getTotalUnreadMsgCount(new BaseListener(result));
|
Open_im_sdk.getTotalUnreadMsgCount(new BaseListener(result));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void forceSyncMsg(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
|
Open_im_sdk.forceSyncMsg();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -3,6 +3,7 @@ library flutter_openim_sdk;
|
|||||||
export 'src/enum/conversation_type.dart';
|
export 'src/enum/conversation_type.dart';
|
||||||
export 'src/enum/group_role.dart';
|
export 'src/enum/group_role.dart';
|
||||||
export 'src/enum/listener_type.dart';
|
export 'src/enum/listener_type.dart';
|
||||||
|
export 'src/enum/message_status.dart';
|
||||||
export 'src/enum/message_type.dart';
|
export 'src/enum/message_type.dart';
|
||||||
export 'src/listener/advanced_msg_listener.dart';
|
export 'src/listener/advanced_msg_listener.dart';
|
||||||
export 'src/listener/conversation_listener.dart';
|
export 'src/listener/conversation_listener.dart';
|
||||||
|
6
lib/src/enum/message_status.dart
Normal file
6
lib/src/enum/message_status.dart
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
class MessageStatus{
|
||||||
|
static const sending = 1;
|
||||||
|
static const succeeded = 2;
|
||||||
|
static const failed = 3;
|
||||||
|
static const deleted = 4;
|
||||||
|
}
|
@ -1,20 +1,32 @@
|
|||||||
class MessageType {
|
class MessageType {
|
||||||
///
|
///
|
||||||
static const text = 101;
|
static const text = 101;
|
||||||
|
|
||||||
///
|
|
||||||
static const picture = 102;
|
static const picture = 102;
|
||||||
|
|
||||||
///
|
|
||||||
static const voice = 103;
|
static const voice = 103;
|
||||||
|
|
||||||
///
|
|
||||||
static const video = 104;
|
static const video = 104;
|
||||||
|
static const file = 105;
|
||||||
|
static const at_text = 106;
|
||||||
|
static const merger = 107;
|
||||||
|
|
||||||
///
|
///
|
||||||
static const file = 105;
|
|
||||||
|
|
||||||
static const accept_friend = 201;
|
static const accept_friend = 201;
|
||||||
|
static const add_friend = 202;
|
||||||
|
static const refuse_friend_application = 203;
|
||||||
|
static const set_self_info = 204;
|
||||||
|
static const revoke_message = 205;
|
||||||
|
static const c2c_message_as_read = 206;
|
||||||
|
static const kick_online = 303;
|
||||||
|
|
||||||
|
///
|
||||||
|
static const transfer_group_owner = 501;
|
||||||
static const create_group = 502;
|
static const create_group = 502;
|
||||||
|
|
||||||
|
// static const create_group = 503;
|
||||||
|
static const join_group = 504;
|
||||||
|
static const quit_group = 505;
|
||||||
|
static const set_group_info = 506;
|
||||||
|
static const accept_group_application = 507;
|
||||||
|
static const refuse_group_application = 508;
|
||||||
|
static const kick_group_member = 509;
|
||||||
|
static const invited_user_to_group = 510;
|
||||||
}
|
}
|
||||||
|
@ -46,7 +46,7 @@ class GroupManager {
|
|||||||
'reason': reason,
|
'reason': reason,
|
||||||
'uidList': uidList,
|
'uidList': uidList,
|
||||||
}))
|
}))
|
||||||
.then((value) => _formatJson(value)
|
.then((value) => (_formatJson(value) as List)
|
||||||
.map((e) => GroupInviteResult.fromJson(e))
|
.map((e) => GroupInviteResult.fromJson(e))
|
||||||
.toList());
|
.toList());
|
||||||
}
|
}
|
||||||
@ -71,8 +71,8 @@ class GroupManager {
|
|||||||
///begin index, pull and fill 0 for the first time
|
///begin index, pull and fill 0 for the first time
|
||||||
Future<GroupMembersList> getGroupMemberList({
|
Future<GroupMembersList> getGroupMemberList({
|
||||||
required String groupId,
|
required String groupId,
|
||||||
required int filter,
|
int filter = 0,
|
||||||
required int next,
|
int next = 0,
|
||||||
}) {
|
}) {
|
||||||
return _channel
|
return _channel
|
||||||
.invokeMethod(
|
.invokeMethod(
|
||||||
@ -195,6 +195,22 @@ class GroupManager {
|
|||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void forceSyncApplyGroupRequest() {
|
||||||
|
_channel.invokeMethod('forceSyncApplyGroupRequest', _buildParam({}));
|
||||||
|
}
|
||||||
|
|
||||||
|
void forceSyncGroupRequest() {
|
||||||
|
_channel.invokeMethod('forceSyncGroupRequest', _buildParam({}));
|
||||||
|
}
|
||||||
|
|
||||||
|
void forceSyncJoinedGroup() {
|
||||||
|
_channel.invokeMethod('forceSyncJoinedGroup', _buildParam({}));
|
||||||
|
}
|
||||||
|
|
||||||
|
void forceSyncJoinedGroupMember() {
|
||||||
|
_channel.invokeMethod('forceSyncJoinedGroupMember', _buildParam({}));
|
||||||
|
}
|
||||||
|
|
||||||
static Map _buildParam(Map param) {
|
static Map _buildParam(Map param) {
|
||||||
param["ManagerName"] = "groupManager";
|
param["ManagerName"] = "groupManager";
|
||||||
return param;
|
return param;
|
||||||
|
@ -12,7 +12,9 @@ class IMManager {
|
|||||||
late OfflinePushManager offlinePushManager;
|
late OfflinePushManager offlinePushManager;
|
||||||
late SignalingManager signalingManager;
|
late SignalingManager signalingManager;
|
||||||
late InitSDKListener _initSDKListener;
|
late InitSDKListener _initSDKListener;
|
||||||
late String logUid;
|
late String uid;
|
||||||
|
|
||||||
|
// late UserInfo userInfo;
|
||||||
|
|
||||||
IMManager(this._channel) {
|
IMManager(this._channel) {
|
||||||
conversationManager = ConversationManager(_channel);
|
conversationManager = ConversationManager(_channel);
|
||||||
@ -32,8 +34,8 @@ class IMManager {
|
|||||||
dynamic data = call.arguments['data'];
|
dynamic data = call.arguments['data'];
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case 'onSelfInfoUpdated':
|
case 'onSelfInfoUpdated':
|
||||||
var u = UserInfo.fromJson(_formatJson(data));
|
_initSDKListener
|
||||||
_initSDKListener.onSelfInfoUpdated(u);
|
.onSelfInfoUpdated(UserInfo.fromJson(_formatJson(data)));
|
||||||
break;
|
break;
|
||||||
case 'onConnectFailed':
|
case 'onConnectFailed':
|
||||||
int? errCode = call.arguments['errCode'];
|
int? errCode = call.arguments['errCode'];
|
||||||
@ -279,8 +281,8 @@ class IMManager {
|
|||||||
return _channel.invokeMethod('unInitSDK', _buildParam({}));
|
return _channel.invokeMethod('unInitSDK', _buildParam({}));
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<dynamic> login({required String uid, required String token}) {
|
Future<dynamic> login({required String uid, required String token}) async {
|
||||||
this.logUid = uid;
|
this.uid = uid;
|
||||||
return _channel.invokeMethod(
|
return _channel.invokeMethod(
|
||||||
'login',
|
'login',
|
||||||
_buildParam({'uid': uid, 'token': token}),
|
_buildParam({'uid': uid, 'token': token}),
|
||||||
@ -296,7 +298,12 @@ class IMManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Future<String?> getLoginUid() {
|
Future<String?> getLoginUid() {
|
||||||
return _channel.invokeMethod<String>('getLoginUid', _buildParam({}));
|
return Future.value(uid);
|
||||||
|
// return _channel.invokeMethod<String>('getLoginUid', _buildParam({}));
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<UserInfo> getLoginUserInfo() {
|
||||||
|
return getUsersInfo([uid]).then((list) => list[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<String?> setSelfInfo(UserInfo info) {
|
Future<String?> setSelfInfo(UserInfo info) {
|
||||||
@ -314,6 +321,10 @@ class IMManager {
|
|||||||
return _channel.invokeMethod('forceSyncLoginUerInfo', _buildParam({}));
|
return _channel.invokeMethod('forceSyncLoginUerInfo', _buildParam({}));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Future<dynamic> forceReConn() {
|
||||||
|
return _channel.invokeMethod('forceReConn', _buildParam({}));
|
||||||
|
}
|
||||||
|
|
||||||
static Map _buildParam(Map param) {
|
static Map _buildParam(Map param) {
|
||||||
param["ManagerName"] = "imManager";
|
param["ManagerName"] = "imManager";
|
||||||
return param;
|
return param;
|
||||||
|
@ -202,6 +202,10 @@ class MessageManager {
|
|||||||
return _channel.invokeMethod('getTotalUnreadMsgCount', _buildParam({}));
|
return _channel.invokeMethod('getTotalUnreadMsgCount', _buildParam({}));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void forceSyncMsg() {
|
||||||
|
_channel.invokeMethod('forceSyncMsg', _buildParam({}));
|
||||||
|
}
|
||||||
|
|
||||||
static Map _buildParam(Map param) {
|
static Map _buildParam(Map param) {
|
||||||
param["ManagerName"] = "messageManager";
|
param["ManagerName"] = "messageManager";
|
||||||
return param;
|
return param;
|
||||||
|
@ -75,14 +75,17 @@ class GroupMembersInfo {
|
|||||||
int? joinTime;
|
int? joinTime;
|
||||||
String? nickName;
|
String? nickName;
|
||||||
String? faceUrl;
|
String? faceUrl;
|
||||||
|
dynamic ext;
|
||||||
|
|
||||||
GroupMembersInfo(
|
GroupMembersInfo({
|
||||||
{this.groupID,
|
this.groupID,
|
||||||
this.userId,
|
this.userId,
|
||||||
this.role,
|
this.role,
|
||||||
this.joinTime,
|
this.joinTime,
|
||||||
this.nickName,
|
this.nickName,
|
||||||
this.faceUrl});
|
this.faceUrl,
|
||||||
|
this.ext,
|
||||||
|
});
|
||||||
|
|
||||||
GroupMembersInfo.fromJson(Map<String, dynamic> json) {
|
GroupMembersInfo.fromJson(Map<String, dynamic> json) {
|
||||||
groupID = json['groupID'];
|
groupID = json['groupID'];
|
||||||
@ -91,6 +94,7 @@ class GroupMembersInfo {
|
|||||||
joinTime = json['joinTime'];
|
joinTime = json['joinTime'];
|
||||||
nickName = json['nickName'];
|
nickName = json['nickName'];
|
||||||
faceUrl = json['faceUrl'];
|
faceUrl = json['faceUrl'];
|
||||||
|
ext = json['ext'];
|
||||||
}
|
}
|
||||||
|
|
||||||
Map<String, dynamic> toJson() {
|
Map<String, dynamic> toJson() {
|
||||||
@ -101,6 +105,7 @@ class GroupMembersInfo {
|
|||||||
data['joinTime'] = this.joinTime;
|
data['joinTime'] = this.joinTime;
|
||||||
data['nickName'] = this.nickName;
|
data['nickName'] = this.nickName;
|
||||||
data['faceUrl'] = this.faceUrl;
|
data['faceUrl'] = this.faceUrl;
|
||||||
|
data['ext'] = this.ext;
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -23,32 +23,35 @@ class Message {
|
|||||||
SoundElem? soundElem;
|
SoundElem? soundElem;
|
||||||
VideoElem? videoElem;
|
VideoElem? videoElem;
|
||||||
FileElem? fileElem;
|
FileElem? fileElem;
|
||||||
|
AtElem? atElem;
|
||||||
|
|
||||||
Message(
|
Message({
|
||||||
{this.clientMsgID,
|
this.clientMsgID,
|
||||||
this.serverMsgID,
|
this.serverMsgID,
|
||||||
this.createTime,
|
this.createTime,
|
||||||
this.sendTime,
|
this.sendTime,
|
||||||
this.sendID,
|
this.sendID,
|
||||||
this.recvID,
|
this.recvID,
|
||||||
this.msgFrom,
|
this.msgFrom,
|
||||||
this.contentType,
|
this.contentType,
|
||||||
this.platformID,
|
this.platformID,
|
||||||
this.forceList,
|
this.forceList,
|
||||||
this.senderNickName,
|
this.senderNickName,
|
||||||
this.senderFaceUrl,
|
this.senderFaceUrl,
|
||||||
this.groupID,
|
this.groupID,
|
||||||
this.content,
|
this.content,
|
||||||
this.seq,
|
this.seq,
|
||||||
this.isRead,
|
this.isRead,
|
||||||
this.status,
|
this.status,
|
||||||
this.remark,
|
this.remark,
|
||||||
this.ext,
|
this.ext,
|
||||||
this.sessionType,
|
this.sessionType,
|
||||||
this.pictureElem,
|
this.pictureElem,
|
||||||
this.soundElem,
|
this.soundElem,
|
||||||
this.videoElem,
|
this.videoElem,
|
||||||
this.fileElem});
|
this.fileElem,
|
||||||
|
this.atElem,
|
||||||
|
});
|
||||||
|
|
||||||
Message.fromJson(Map<String, dynamic> json)
|
Message.fromJson(Map<String, dynamic> json)
|
||||||
/* : clientMsgID = json['clientMsgID']*/ {
|
/* : clientMsgID = json['clientMsgID']*/ {
|
||||||
@ -61,7 +64,9 @@ class Message {
|
|||||||
msgFrom = json['msgFrom'];
|
msgFrom = json['msgFrom'];
|
||||||
contentType = json['contentType'];
|
contentType = json['contentType'];
|
||||||
platformID = json['platformID'];
|
platformID = json['platformID'];
|
||||||
forceList = json['forceList'];
|
if (json['forceList'] is List) {
|
||||||
|
forceList = (json['forceList'] as List).map((e) => '$e').toList();
|
||||||
|
}
|
||||||
senderNickName = json['senderNickName'];
|
senderNickName = json['senderNickName'];
|
||||||
senderFaceUrl = json['senderFaceUrl'];
|
senderFaceUrl = json['senderFaceUrl'];
|
||||||
groupID = json['groupID'];
|
groupID = json['groupID'];
|
||||||
@ -73,17 +78,17 @@ class Message {
|
|||||||
ext = json['ext'];
|
ext = json['ext'];
|
||||||
sessionType = json['sessionType'];
|
sessionType = json['sessionType'];
|
||||||
pictureElem = json['pictureElem'] != null
|
pictureElem = json['pictureElem'] != null
|
||||||
? new PictureElem.fromJson(json['pictureElem'])
|
? PictureElem.fromJson(json['pictureElem'])
|
||||||
: null;
|
: null;
|
||||||
soundElem = json['soundElem'] != null
|
soundElem = json['soundElem'] != null
|
||||||
? new SoundElem.fromJson(json['soundElem'])
|
? SoundElem.fromJson(json['soundElem'])
|
||||||
: null;
|
: null;
|
||||||
videoElem = json['videoElem'] != null
|
videoElem = json['videoElem'] != null
|
||||||
? new VideoElem.fromJson(json['videoElem'])
|
? VideoElem.fromJson(json['videoElem'])
|
||||||
: null;
|
|
||||||
fileElem = json['fileElem'] != null
|
|
||||||
? new FileElem.fromJson(json['fileElem'])
|
|
||||||
: null;
|
: null;
|
||||||
|
fileElem =
|
||||||
|
json['fileElem'] != null ? FileElem.fromJson(json['fileElem']) : null;
|
||||||
|
atElem = json['atElem'] != null ? AtElem.fromJson(json['atElem']) : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
Map<String, dynamic> toJson() {
|
Map<String, dynamic> toJson() {
|
||||||
@ -120,6 +125,9 @@ class Message {
|
|||||||
if (this.fileElem != null) {
|
if (this.fileElem != null) {
|
||||||
data['fileElem'] = this.fileElem!.toJson();
|
data['fileElem'] = this.fileElem!.toJson();
|
||||||
}
|
}
|
||||||
|
if (this.atElem != null) {
|
||||||
|
data['atElem'] = this.atElem!.toJson();
|
||||||
|
}
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -335,3 +343,68 @@ class FileElem {
|
|||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class AtElem {
|
||||||
|
String? text;
|
||||||
|
List<String>? atUserList;
|
||||||
|
bool? isAtSelf;
|
||||||
|
|
||||||
|
AtElem({this.text, this.atUserList, this.isAtSelf});
|
||||||
|
|
||||||
|
AtElem.fromJson(Map<String, dynamic> json) {
|
||||||
|
text = json['text'];
|
||||||
|
if (json['atUserList'] is List) {
|
||||||
|
atUserList = (json['atUserList'] as List).map((e) => '$e').toList();
|
||||||
|
}
|
||||||
|
isAtSelf = json['isAtSelf'];
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||||
|
data['text'] = this.text;
|
||||||
|
data['atUserList'] = this.atUserList;
|
||||||
|
data['isAtSelf'] = this.isAtSelf;
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class RevokeMessage {
|
||||||
|
String? serverMsgID;
|
||||||
|
String? sendID;
|
||||||
|
String? senderNickname;
|
||||||
|
String? recvID;
|
||||||
|
String? groupID;
|
||||||
|
int? contentType;
|
||||||
|
int? sendTime;
|
||||||
|
|
||||||
|
RevokeMessage(
|
||||||
|
{this.serverMsgID,
|
||||||
|
this.sendID,
|
||||||
|
this.senderNickname,
|
||||||
|
this.recvID,
|
||||||
|
this.groupID,
|
||||||
|
this.contentType,
|
||||||
|
this.sendTime});
|
||||||
|
|
||||||
|
RevokeMessage.fromJson(Map<String, dynamic> json) {
|
||||||
|
serverMsgID = json['serverMsgID'];
|
||||||
|
sendID = json['sendID'];
|
||||||
|
senderNickname = json['senderNickname'];
|
||||||
|
recvID = json['recvID'];
|
||||||
|
groupID = json['groupID'];
|
||||||
|
contentType = json['contentType'];
|
||||||
|
sendTime = json['sendTime'];
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||||
|
data['serverMsgID'] = this.serverMsgID;
|
||||||
|
data['sendID'] = this.sendID;
|
||||||
|
data['senderNickname'] = this.senderNickname;
|
||||||
|
data['recvID'] = this.recvID;
|
||||||
|
data['groupID'] = this.groupID;
|
||||||
|
data['contentType'] = this.contentType;
|
||||||
|
data['sendTime'] = this.sendTime;
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import 'package:flutter_openim_sdk/flutter_openim_sdk.dart';
|
import 'dart:convert';
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
/* const MethodChannel channel = MethodChannel('flutter_openim_sdk');
|
/* const MethodChannel channel = MethodChannel('flutter_openim_sdk');
|
||||||
@ -17,14 +17,21 @@ void main() {
|
|||||||
|
|
||||||
test('getPlatformVersion', () async {});*/
|
test('getPlatformVersion', () async {});*/
|
||||||
|
|
||||||
Message m1 = new Message(clientMsgID: '1', content: 'c1');
|
// Message m1 = new Message(clientMsgID: '1', content: 'c1');
|
||||||
Message m2 = new Message(clientMsgID: '2', content: 'c2');
|
// Message m2 = new Message(clientMsgID: '2', content: 'c2');
|
||||||
Message m3 = new Message(clientMsgID: '3', content: 'c3');
|
// Message m3 = new Message(clientMsgID: '3', content: 'c3');
|
||||||
Message m4 = new Message(clientMsgID: '3', content: 'c4');
|
// Message m4 = new Message(clientMsgID: '3', content: 'c4');
|
||||||
List list = List.of([m1, m2, m3]);
|
// List list = List.of([m1, m2, m3]);
|
||||||
|
//
|
||||||
print(list.contains(m4));
|
// print(list.contains(m4));
|
||||||
print(m1 == m4);
|
// print(m1 == m4);
|
||||||
print(m2 == m4);
|
// print(m2 == m4);
|
||||||
print(m3 == m4);
|
// print(m3 == m4);
|
||||||
|
var input = "1234 @abc @bbc @hha 开什么玩笑";
|
||||||
|
RegExp exp = new RegExp(r"(@\w+) ");
|
||||||
|
final ms = exp.allMatches(input);
|
||||||
|
for (Match m in ms) {
|
||||||
|
String match = m.group(0)??'';
|
||||||
|
print('====$match ${m.start} ${m.end}');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user