diff --git a/lib/ui/compositing.dart b/lib/ui/compositing.dart index 39b0d63fc2b36..7a7bf9ed47267 100644 --- a/lib/ui/compositing.dart +++ b/lib/ui/compositing.dart @@ -715,8 +715,6 @@ class SceneBuilder extends NativeFieldWrapperClass2 { /// Adds a platform view (e.g an iOS UIView) to the scene. /// - /// Only supported on iOS, this is currently a no-op on other platforms. - /// /// On iOS this layer splits the current output surface into two surfaces, one for the scene nodes /// preceding the platform view, and one for the scene nodes following the platform view. /// @@ -729,6 +727,8 @@ class SceneBuilder extends NativeFieldWrapperClass2 { /// With a platform view in the scene, Quartz has to composite the two Flutter surfaces and the /// embedded UIView. In addition to that, on iOS versions greater than 9, the Flutter frames are /// synchronized with the UIView frames adding additional performance overhead. + /// + /// The `offset` argument is not used for iOS and Android. void addPlatformView( int viewId, { Offset offset = Offset.zero, diff --git a/testing/scenario_app/lib/src/platform_view.dart b/testing/scenario_app/lib/src/platform_view.dart index 90fc0693e0433..e9802438eb5e4 100644 --- a/testing/scenario_app/lib/src/platform_view.dart +++ b/testing/scenario_app/lib/src/platform_view.dart @@ -707,21 +707,15 @@ mixin _BasePlatformViewScenarioMixin on Scenario { SceneBuilder sceneBuilder, int viewId, double width, - double height, { - Offset overlayOffset, - }) { - overlayOffset ??= const Offset(50, 50); + double height, + ) { if (Platform.isIOS) { - sceneBuilder.addPlatformView(viewId, offset: overlayOffset, width: width, height: height); + sceneBuilder.addPlatformView(viewId, width: width, height: height); } else if (Platform.isAndroid) { if (usesAndroidHybridComposition) { - // Hybrid composition does not support `offset`. - // https://github.com/flutter/flutter/issues/60630 - sceneBuilder.pushOffset(overlayOffset.dx, overlayOffset.dy); sceneBuilder.addPlatformView(viewId, width: width, height: height); - sceneBuilder.pop(); } else if (_textureId != null) { - sceneBuilder.addTexture(_textureId, offset: overlayOffset, width: width, height: height); + sceneBuilder.addTexture(_textureId, width: width, height: height); } } else { throw UnsupportedError('Platform ${Platform.operatingSystem} is not supported'); @@ -740,7 +734,6 @@ mixin _BasePlatformViewScenarioMixin on Scenario { viewId, 500, 500, - overlayOffset: overlayOffset, ); final PictureRecorder recorder = PictureRecorder(); final Canvas canvas = Canvas(recorder);