Skip to content

FlutterView can't be used as a transparent overlay #9627

@ds84182

Description

@ds84182

In engine, the screen is filled with SK_ColorBLACK. 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.

I've solved this temporarily by punching a hole in the Skia canvas by drawing a rectangle with the paint new Paint()..blendMode = BlendMode.clear; using a BoxDecoration and a BoxPainter, but this isn't very intuitive.

I've also hit some Android specific snags. It would be great if FlutterView had a method named useAsOverlay that calls setZOrderOnTop(true) and getHolder().setFormat(PixelFormat.TRANSLUCENT). Right now my Android code depends on FlutterView being a SurfaceView, but I'm not entirely confident that it'll remain that way.

Metadata

Metadata

Assignees

Labels

a: existing-appsIntegration with existing apps via the add-to-app flowc: new featureNothing broken; request for a new capabilitycustomer: dream (g3)engineflutter/engine related. See also e: labels.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions