SheenGlass class Glass
A frosted-glass surface, drawn in Flutter with no platform views and no shaders.
It blurs and saturates what is behind it, lays a body gradient over a tint, and draws a 1 px gradient rim, inner edge lines, a specular highlight and an outer shadow. variant picks the recipe from the theme (SheenThemeData.glass); style overrides it.
SheenGlass(
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 10),
child: Text('Glass', style: context.sheen.type.headline),
)
Performance: every glass surface under one BackdropGroup shares a single copy of the backdrop. SheenScope
provides that group; add another per route if your screens are not under it. Do not put glass inside list items:
a blur per row is expensive. Use a plain card there.
Accessibility: with high contrast on (MediaQuery.highContrastOf) or SheenThemeData.reduceTransparency set,
the glass becomes an opaque surface with a visible border.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatelessWidget
- SheenGlass
Constructors
- SheenGlass({Key? key, required Widget child, ShapeBorder shape = const StadiumBorder(), SheenGlassVariant variant = SheenGlassVariant.regular, EdgeInsetsGeometry? padding, SheenGlassStyle? style})
-
A glass surface in
shape(a capsule by default) aroundchild.const
Properties
- child → Widget
-
The content on the glass.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- padding → EdgeInsetsGeometry?
-
Space between the glass edge and child.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- shape → ShapeBorder
-
The outline of the glass; a capsule by default. Use
RoundedRectangleBorderorRoundedSuperellipseBorderfor cards and panels.final - style → SheenGlassStyle?
-
A recipe that replaces the theme's one for this surface.
final
- variant → SheenGlassVariant
-
Which of the theme's recipes to draw.
final
Methods
-
build(
BuildContext context) → Widget -
Describes the part of the user interface represented by this widget.
override
-
createElement(
) → StatelessElement -
Creates a StatelessElement to manage this widget's location in the tree.
inherited
-
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
-
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
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited