plugin_framework, fix dup ui widgets
Signed-off-by: fufesou <shuanglongchen@yeah.net>
This commit is contained in:
parent
2e12d66615
commit
c315924ef7
@ -23,7 +23,16 @@ class PluginModel with ChangeNotifier {
|
|||||||
final Map<String, String> opts = {};
|
final Map<String, String> opts = {};
|
||||||
|
|
||||||
void add(UiType ui) {
|
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();
|
notifyListeners();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -181,7 +181,6 @@ struct VideoRenderer {
|
|||||||
ptr: usize,
|
ptr: usize,
|
||||||
width: usize,
|
width: usize,
|
||||||
height: usize,
|
height: usize,
|
||||||
size: usize,
|
|
||||||
on_rgba_func: Option<Symbol<'static, FlutterRgbaRendererPluginOnRgba>>,
|
on_rgba_func: Option<Symbol<'static, FlutterRgbaRendererPluginOnRgba>>,
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -210,7 +209,6 @@ impl Default for VideoRenderer {
|
|||||||
ptr: 0,
|
ptr: 0,
|
||||||
width: 0,
|
width: 0,
|
||||||
height: 0,
|
height: 0,
|
||||||
size: 0,
|
|
||||||
on_rgba_func,
|
on_rgba_func,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user