GlassContainer class

Inheritance

Constructors

GlassContainer.new({Key? key, Widget? child, double? width, double? height, EdgeInsetsGeometry? padding, EdgeInsetsGeometry? margin, AlignmentGeometry? alignment, GlassType type = GlassType.frosted, GlassShape shape = GlassShape.roundedRectangle, BorderRadius? borderRadius, double? radius, Color? backgroundColor, double backgroundOpacity = 0.2, double blurIntensity = 10.0, Border? border, Color? borderColor, double borderWidth = 1.0, double borderOpacity = 0.2, List<BoxShadow>? boxShadow, bool addShadow = true, Color? shadowColor, double shadowBlurRadius = 20.0, double shadowSpreadRadius = 0.0, Offset shadowOffset = const Offset(0, 8), Gradient? gradient, double gradientOpacity = 0.1, Clip clipBehavior = Clip.antiAlias, Matrix4? transform, AlignmentGeometry? transformAlignment, VoidCallback? onTap, VoidCallback? onLongPress, VoidCallback? onDoubleTap})
const

Properties

addShadow bool
Whether to add default shadow
final
alignment AlignmentGeometry?
Alignment of the child widget
final
backgroundColor Color?
Background color (will be applied with opacity)
final
backgroundOpacity double
Background opacity (0.0 to 1.0)
final
blurIntensity double
Blur intensity (higher = more blur)
final
border Border?
Border configuration
final
borderColor Color?
Border color
final
borderOpacity double
Border opacity
final
borderRadius BorderRadius?
Border radius (for rounded shapes)
final
borderWidth double
Border width
final
boxShadow List<BoxShadow>?
Shadow configuration
final
child Widget?
Child widget to be displayed inside the glass container
final
clipBehavior Clip
Clip behavior
final
gradient Gradient?
Gradient overlay (applied over background color)
final
gradientOpacity double
Gradient opacity
final
hashCode int
The hash code for this object.
no setterinherited
height double?
Height of the container
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
margin EdgeInsetsGeometry?
Margin around the container
final
onDoubleTap VoidCallback?
Double tap callback
final
onLongPress VoidCallback?
Long press callback
final
onTap VoidCallback?
Tap callback
final
padding EdgeInsetsGeometry?
Padding inside the container
final
radius double?
Custom border radius value (shortcut for all corners)
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
shadowBlurRadius double
Shadow blur radius
final
shadowColor Color?
Shadow color
final
shadowOffset Offset
Shadow offset
final
shadowSpreadRadius double
Shadow spread radius
final
shape GlassShape
Shape of the glass container
final
transform Matrix4?
Transform matrix
final
transformAlignment AlignmentGeometry?
Transform alignment
final
type GlassType
Glass effect type (predefined styles)
final
width double?
Width of the container
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

Static Methods

appBar({Key? key, required Widget child, double? height, GlassType type = GlassType.crystal}) GlassContainer
bottomSheet({Key? key, required Widget child, EdgeInsetsGeometry? padding, GlassType type = GlassType.frosted}) GlassContainer
button({Key? key, required Widget child, required VoidCallback onTap, EdgeInsetsGeometry? padding, GlassType type = GlassType.crystal}) GlassContainer
card({Key? key, required Widget child, EdgeInsetsGeometry? padding, EdgeInsetsGeometry? margin, VoidCallback? onTap, GlassType type = GlassType.frosted}) GlassContainer
dialog({Key? key, required Widget child, double? width, double? height, EdgeInsetsGeometry? padding, GlassType type = GlassType.frosted}) GlassContainer
overlay({Key? key, required Widget child, GlassType type = GlassType.smoky, VoidCallback? onTap}) GlassContainer