Unverified Commit c1f6b32c authored by Jim Graham's avatar Jim Graham Committed by GitHub

Stabilize hybrid_android_views_integration_test rendering tree (#130751)

Fixes: https://github.com/flutter/flutter/issues/130738

A widget was added to explicitly and intentionally overlap the
PlatformView so that the rendering tree of Views would always have an
underlay and an overlay to match the test expectations.
parent 236a131c
...@@ -51,13 +51,30 @@ class NestedViewEventBodyState extends State<NestedViewEventBody> { ...@@ -51,13 +51,30 @@ class NestedViewEventBodyState extends State<NestedViewEventBody> {
children: <Widget>[ children: <Widget>[
SizedBox( SizedBox(
height: 300, height: 300,
child: showPlatformView ? child: Stack(
alignment: Alignment.topCenter,
children: <Widget>[
if (showPlatformView)
AndroidPlatformView( AndroidPlatformView(
key: const ValueKey<String>('PlatformView'), key: const ValueKey<String>('PlatformView'),
viewType: 'simple_view', viewType: 'simple_view',
onPlatformViewCreated: onPlatformViewCreated, onPlatformViewCreated: onPlatformViewCreated,
useHybridComposition: useHybridComposition, useHybridComposition: useHybridComposition,
) : null, ),
// The overlapping widget stabilizes the view tree by ensuring
// that there is widget content on top of the platform view.
// Without this widget, we rely on the UI elements down below
// to "incidentally" draw on top of the PlatformView which
// is not a reliable behavior as we eliminate non-visible
// rendering operations throughout the framework and engine.
const Positioned(
top: 50,
child: Text('overlapping widget',
style: TextStyle(color: Colors.yellow),
),
),
],
),
), ),
if (_lastTestStatus != _LastTestStatus.pending) _statusWidget(), if (_lastTestStatus != _LastTestStatus.pending) _statusWidget(),
if (viewChannel != null) ... <Widget>[ if (viewChannel != null) ... <Widget>[
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment