diff --git a/testing/scenario_app/lib/src/platform_view.dart b/testing/scenario_app/lib/src/platform_view.dart index 7c15465dc9ea8..39e6d42c16c97 100644 --- a/testing/scenario_app/lib/src/platform_view.dart +++ b/testing/scenario_app/lib/src/platform_view.dart @@ -1758,6 +1758,7 @@ class PlatformViewsWithClipsScrolling extends Scenario } final Map _createdPlatformViews = {}; +final Map _calledToBeCreatedPlatformViews = {}; /// Adds the platform view to the scene. /// @@ -1787,6 +1788,10 @@ void addPlatformView( ); return; } + if (_calledToBeCreatedPlatformViews.containsKey(platformViewKey)) { + return; + } + _calledToBeCreatedPlatformViews[platformViewKey] = true; final bool usesAndroidHybridComposition = scenarioParams['use_android_view'] as bool? ?? false; final bool expectAndroidHybridCompositionFallback =