diff --git a/flutter/lib/plugin/model.dart b/flutter/lib/plugin/model.dart index 24bcd560c..120f33117 100644 --- a/flutter/lib/plugin/model.dart +++ b/flutter/lib/plugin/model.dart @@ -23,7 +23,16 @@ class PluginModel with ChangeNotifier { final Map 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(); } diff --git a/src/flutter.rs b/src/flutter.rs index 6207eb4e3..cc774ebf3 100644 --- a/src/flutter.rs +++ b/src/flutter.rs @@ -181,7 +181,6 @@ struct VideoRenderer { ptr: usize, width: usize, height: usize, - size: usize, on_rgba_func: Option>, } @@ -210,7 +209,6 @@ impl Default for VideoRenderer { ptr: 0, width: 0, height: 0, - size: 0, on_rgba_func, } }