Brett
2024-01-08 11:39:17 +08:00
parent da148f78e3
commit 98227756df
9 changed files with 34 additions and 15 deletions

View File

@@ -9,6 +9,7 @@ class OnAdvancedMsgListener {
Function(String msgID, List<String> list)? onRecvMessageExtensionsDeleted;
Function(Message msg)? onRecvNewMessage;
Function(Message msg)? onRecvOfflineNewMessage;
Function(Message msg)? onRecvOnlineOnlyMessage;
/// Uniquely identifies
String id;
@@ -21,6 +22,7 @@ class OnAdvancedMsgListener {
this.onRecvMessageExtensionsDeleted,
this.onRecvNewMessage,
this.onRecvOfflineNewMessage,
this.onRecvOnlineOnlyMessage,
}) : id = "id_${DateTime.now().microsecondsSinceEpoch}";
void msgDeleted(Message msg) {
@@ -56,4 +58,8 @@ class OnAdvancedMsgListener {
void recvOfflineNewMessage(Message msg) {
onRecvOfflineNewMessage?.call(msg);
}
void recvOnlineOnlyMessage(Message msg) {
onRecvOnlineOnlyMessage?.call(msg);
}
}

View File

@@ -160,6 +160,11 @@ class IMManager {
final msg = Utils.toObj(value, (map) => Message.fromJson(map));
messageManager.msgListener.recvOfflineNewMessage(msg);
break;
case 'onRecvOnlineOnlyMessage':
var value = call.arguments['data']['message'];
final msg = Utils.toObj(value, (map) => Message.fromJson(map));
messageManager.msgListener.recvOnlineOnlyMessage(msg);
break;
}
} else if (call.method == ListenerType.msgSendProgressListener) {
String type = call.arguments['type'];
@@ -279,10 +284,10 @@ class IMManager {
String type = call.arguments['type'];
dynamic data = call.arguments['data'];
switch (type) {
case 'onProgress':
int size = data['size'];
int current = data['current'];
_uploadLogsListener?.onProgress(current, size);
case 'onProgress':
int size = data['size'];
int current = data['current'];
_uploadLogsListener?.onProgress(current, size);
}
} else if (call.method == ListenerType.uploadFileListener) {
String type = call.arguments['type'];
@@ -383,7 +388,6 @@ class IMManager {
required String dataDir,
required OnConnectListener listener,
int logLevel = 6,
String objectStorage = 'minio',
bool isCompression = false,
bool isLogStandardOutput = true,
String? logFilePath,
@@ -399,7 +403,6 @@ class IMManager {
"wsAddr": wsAddr,
"dataDir": dataDir,
"logLevel": logLevel,
"objectStorage": objectStorage,
"isCompression": isCompression,
"isLogStandardOutput": isLogStandardOutput,
"logFilePath": logFilePath,

View File

@@ -3,7 +3,6 @@ class InitConfig {
String apiAddr;
String wsAddr;
String dataDir;
String objectStorage;
int logLevel;
bool isLogStandardOutput;
String? logFilePath;
@@ -13,7 +12,6 @@ class InitConfig {
required this.apiAddr,
required this.wsAddr,
required this.dataDir,
required this.objectStorage,
this.logLevel = 6,
this.isLogStandardOutput = true,
this.logFilePath,
@@ -25,7 +23,6 @@ class InitConfig {
apiAddr: json['apiAddr'],
wsAddr: json['wsAddr'],
dataDir: json['dataDir'],
objectStorage: json['objectStorage'],
logLevel: json['logLevel'],
isLogStandardOutput: json['isLogStandardOutput'],
logFilePath: json['logFilePath'],
@@ -38,7 +35,6 @@ class InitConfig {
'apiAddr': apiAddr,
'wsAddr': wsAddr,
'dataDir': dataDir,
'objectStorage': objectStorage,
'logLevel': logLevel,
'isLogStandardOutput': isLogStandardOutput,
'logFilePath': logFilePath,

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.5.0-rc.1';
static const version = '3.5.1-alpha.2';
static const _channel = const MethodChannel('flutter_openim_sdk');