GlassProxy class Capture control

Declares what its subtree is in the glass proxy.

One widget for four declarations rather than four widgets, because all four are the same statement — the app telling the proxy something the render tree does not carry — and splitting them would make the caller learn four names to find one.

Nesting: the outermost wins, and the inner one is then unreachable. A GlassProxy.replace under a GlassProxy.hidden is never visited, because the descent stops at the outer one. That is worth knowing rather than pretending the two compose.

What it changes

What the capture sees, not when the host captures. The host decides when to retake by watching the composited layers, and a declaration does not hide a subtree from that: a video that composites a new frame is still a change, under GlassProxy.replace as anywhere. What changes is what the glass shows of it. In the real frame every declaration paints its child as if it were not there.

Constructor Use it for
GlassProxy.hidden Content the glass should not show, or whose paint must not run twice.
GlassProxy.replace A platform view, a Texture, or anything the glass should see as something simpler.
GlassProxy.opaque A box that paints every pixel of itself, so what is under it need not be drawn.
GlassProxy.verbatim A blurred highlight the shadow filter would drop.

Note: A platform view or a Texture records nothing into the capture. Glass over one shows a hole — whatever painted before it, which is usually the page's background — unless a GlassProxy.replace stands in for it.

GlassProxy.replace(
  painter: const SolidProxyPainter(Color(0xFF1C2B3A)), // the map's mean colour
  child: const AndroidView(viewType: 'map'),
)

See also:

Inheritance

Constructors

GlassProxy.hidden({Key? key, required Widget child})
See GlassProxyRole.hidden. The capture skips child and does not run its paint; whatever painted earlier at that place shows instead.
const
GlassProxy.opaque({Key? key, required Widget child})
See GlassProxyRole.opaque. A promise that child paints every pixel of its box opaquely, which makes it an occlusion cover: what is under it is not drawn into the capture. Nothing checks the promise.
const
GlassProxy.replace({Key? key, required Widget child, required GlassProxyPainter? painter})
See GlassProxyRole.replace. child still lays out and still paints into the real frame; only the proxy sees painter instead.
const
GlassProxy.verbatim({Key? key, required Widget child})
See GlassProxyRole.verbatim. child is drawn into the capture with the shadow filter off, so a deliberate MaskFilter blur survives.
const

Properties

child → Widget?
The widget below this widget in the tree.
finalinherited
hashCode → int
The hash code for this object.
no setterinherited
key → Key?
Controls how one widget replaces another widget in the tree.
finalinherited
painter → GlassProxyPainter?
Non-null exactly when role is GlassProxyRole.replace.
final
role → GlassProxyRole
Which of the four declarations this is, set by the constructor.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

createElement() → SingleChildRenderObjectElement
RenderObjectWidgets always inflate to a RenderObjectElement subclass.
inherited
createRenderObject(BuildContext context) → RenderGlassProxy
Creates an instance of the RenderObject class that this RenderObjectWidget represents, using the configuration described by this RenderObjectWidget.
override
debugDescribeChildren() → List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children.
inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
override
didUnmountRenderObject(covariant RenderObject renderObject) → void
This method is called when a RenderObject that was previously associated with this widget is removed from the render tree. The provided RenderObject will be of the same type as the one created by this widget's createRenderObject method.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style}) → DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep.
inherited
toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) → String
A string representation of this object.
inherited
toStringDeep({String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) → String
Returns a string representation of this node and its descendants.
inherited
toStringShallow({String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) → String
Returns a one-line detailed description of the object.
inherited
toStringShort() → String
A short, textual description of this widget.
inherited
updateRenderObject(BuildContext context, covariant RenderGlassProxy renderObject) → void
Copies the configuration described by this RenderObjectWidget to the given RenderObject, which will be of the same type as returned by this object's createRenderObject.
override

Operators

operator ==(Object other) → bool
The equality operator.
inherited