GlassAbove class Composition

Raises every glass surface below it lift levels above the glass beside it.

Wrap what stands on other glass: an app bar or a tab bar over glass cards, a GlassScrollEdge, a menu, a dialog, a sheet. A surface's level is the number of captured glass surfaces it is written inside plus the lifts above it; a level's capture draws every glass of a lower level, so the bar sees the cards.

Glass beside a lifted subtree but painted on top of it is drawn into its capture anyway — levels are a declaration, not paint order. A bar left unlifted over a lifted scroll edge appears blurred in the edge's backdrop; lift the bar with it (GlassScrollEdge.child does).

A level costs one more snapshot on every frame that records, and nothing on a screen with no glass under the lifted subtree: the host numbers only the levels that are occupied, so a lifted bar over plain content is captured with everything else.

Stack(
  children: <Widget>[
    ListView(children: <Widget>[for (final Note note in notes) GlassCard(child: Text(note.title))]),
    Positioned(
      left: 16,
      right: 16,
      bottom: 16,
      child: GlassAbove(child: GlassBar(child: toolbar)), // refracts the cards
    ),
  ],
)

See also:

Inheritance

Constructors

GlassAbove({int lift = 1, Widget? child, Key? key})
Raises the glass in child by lift levels, one by default.
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
lift → int
How many levels the glass below is raised. One for a bar over a page; a modal layer over bars that are themselves lifted takes two (kGlassModalLift).
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) → RenderGlassAbove
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.
inherited
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 RenderGlassAbove 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