mirror of
https://github.com/rustdesk/rustdesk.git
synced 2025-12-12 19:17:58 +00:00
plugin_framework, debug
Signed-off-by: fufesou <shuanglongchen@yeah.net>
This commit is contained in:
@@ -1,11 +1,19 @@
|
||||
import 'dart:convert';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
void handlePluginEvent(
|
||||
Map<String, dynamic> evt,
|
||||
String peer,
|
||||
Function(Map<String, dynamic> e) handleMsgBox,
|
||||
) {
|
||||
if (evt['content']?['c'] == null) return;
|
||||
final t = evt['content']?['t'];
|
||||
if (t == 'MsgBox') {
|
||||
handleMsgBox(evt['content']?['c']);
|
||||
Map<String, dynamic>? content;
|
||||
try {
|
||||
content = json.decode(evt['content']);
|
||||
} catch (e) {
|
||||
debugPrint(
|
||||
'Json decode plugin event content failed: $e, ${evt['content']}');
|
||||
}
|
||||
if (content?['t'] == 'MsgBox') {
|
||||
handleMsgBox(content?['c']);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user