<p dir="auto">This is a fork from <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="326198872" data-permission-text="Title is private" data-url="https://github.com/flutter/flutter/issues/17874" data-hovercard-type="issue" data-hovercard-url="/flutter/flutter/issues/17874/hovercard" href="https://github.com/flutter/flutter/issues/17874">#17874</a> because the use cases for transparent view is a bit different:</p>
<ul dir="auto">
<li>When using a FlutterView which intrinsic sizing, the resize operation causes the contents to be re-rendered. This "flash" is quite visible if the background of the view is black. The flash itself is being tracked here: <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="339646988" data-permission-text="Title is private" data-url="https://github.com/flutter/flutter/issues/19189" data-hovercard-type="issue" data-hovercard-url="/flutter/flutter/issues/19189/hovercard" href="https://github.com/flutter/flutter/issues/19189">#19189</a></li>
<li>Customer dream wants to show background set in a native container through the flutter view. For instance, you can imagine a text box being laid on top of a "wallpaper". Setting this wallpaper in native container + in Flutter view would lead to hard to control artifacts such as mismatched seams.</li>
<li>Certain widgets such as card have implicit margins. This causes a black border to be visible around the card.</li>
</ul>
<p dir="auto"><a href="https://github.com/flutter/engine/blob/1c07ea530f2c78b7e303c96b19994ff897498c2a/shell/gpu/gpu_rasterizer.cc#L136">In engine, the screen is filled with SK_ColorBLACK.</a> This makes it impossible to use FlutterView as a transparent overlay, since canvas clearing is in the hands of the engine instead of the flutter application.</p>
<p dir="auto">I've solved this temporarily by punching a hole in the Skia canvas by drawing a rectangle with the paint <code class="notranslate">new Paint()..blendMode = BlendMode.clear;</code> using a BoxDecoration and a BoxPainter, but this isn't very intuitive.</p>
<p dir="auto">I've also hit some Android specific snags. It would be great if FlutterView had a method named <code class="notranslate">useAsOverlay</code> that calls <code class="notranslate">setZOrderOnTop(true)</code> and <code class="notranslate">getHolder().setFormat(PixelFormat.TRANSLUCENT)</code>. Right now my Android code depends on FlutterView being a SurfaceView, but I'm not entirely confident that it'll remain that way.</p>