plugin_framework, debug listen event

Signed-off-by: fufesou <shuanglongchen@yeah.net>
This commit is contained in:
fufesou
2023-04-27 14:41:53 +08:00
parent 9a457894b3
commit 12ab0a433a
4 changed files with 28 additions and 17 deletions

View File

@@ -260,10 +260,15 @@ class PluginItem extends StatelessWidget {
String? _getOption(OptionModel model, String key) {
var v = model.value;
if (v == null) {
if (peerId.isEmpty) {
v = bind.pluginGetSharedOption(id: pluginId, key: key);
} else {
v = bind.pluginGetSessionOption(id: pluginId, peer: peerId, key: key);
try {
if (peerId.isEmpty) {
v = bind.pluginGetSharedOption(id: pluginId, key: key);
} else {
v = bind.pluginGetSessionOption(id: pluginId, peer: peerId, key: key);
}
} catch (e) {
debugPrint('Failed to get option "$key", $e');
v = null;
}
}
return v;