Merge pull request #4232 from fufesou/feat/plugin_framework

plugin_framework, fix dup ui widgets
This commit is contained in:
RustDesk 2023-04-29 12:49:02 +08:00 committed by GitHub
commit a49b8177b8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 3 deletions

View File

@ -23,7 +23,16 @@ class PluginModel with ChangeNotifier {
final Map<String, String> opts = {};
void add(UiType ui) {
uiList.add(ui);
bool found = false;
for (int i = 0; i < uiList.length; i++) {
if (uiList[i].key == ui.key) {
uiList[i] = ui;
found = true;
}
}
if (!found) {
uiList.add(ui);
}
notifyListeners();
}

View File

@ -181,7 +181,6 @@ struct VideoRenderer {
ptr: usize,
width: usize,
height: usize,
size: usize,
on_rgba_func: Option<Symbol<'static, FlutterRgbaRendererPluginOnRgba>>,
}
@ -210,7 +209,6 @@ impl Default for VideoRenderer {
ptr: 0,
width: 0,
height: 0,
size: 0,
on_rgba_func,
}
}