GlassmorphicContainer class
A container with a glassmorphic effect (blurred transparent background).
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatelessWidget
- GlassmorphicContainer
Constructors
-
GlassmorphicContainer({Key? key, required Widget child, BorderRadius borderRadius = const BorderRadius.all(Radius.circular(16)), double blur = 10.0, List<
Color> colors = const [Colors.white, Colors.white], AlignmentGeometry begin = Alignment.topLeft, AlignmentGeometry end = Alignment.bottomRight, double opacity = 0.2, bool border = true, Color borderColor = Colors.white, double borderWidth = 1.5, bool shadow = true, Color shadowColor = Colors.black, double shadowBlur = 15, double shadowSpread = 5, double? height, double? width, EdgeInsetsGeometry? margin, EdgeInsetsGeometry? padding, Color backgroundColor = Colors.transparent}) -
Creates a glassmorphic container with a frosted glass effect.
const
Properties
- backgroundColor → Color
-
Background color of the container (on top of the blur effect).
Use a transparent color for maximum blur visibility or
add a semi-transparent color for a tinted glass effect.
final
- begin → AlignmentGeometry
-
The gradient start position.
final
- blur → double
-
The blur intensity for the backdrop filter.
final
- border → bool
-
Whether to show a border around the container.
final
- borderColor → Color
-
Color of the border (if border is true).
final
- borderRadius → BorderRadius
-
The border radius of the container.
final
- borderWidth → double
-
Width of the border (if border is true).
final
- child → Widget
-
Child widget to be rendered inside the container.
final
-
colors
→ List<
Color> -
The gradient colors used in the background.
final
- end → AlignmentGeometry
-
The gradient end position.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- height → double?
-
Fixed 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
- opacity → double
-
Opacity level for the colors and effects.
final
- padding → EdgeInsetsGeometry?
-
Padding inside the container.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- shadow → bool
-
Whether to show a shadow under the container.
final
- shadowBlur → double
-
Blur radius of the shadow (if shadow is true).
final
- shadowColor → Color
-
Color of the shadow (if shadow is true).
final
- shadowSpread → double
-
Spread radius of the shadow (if shadow is true).
final
- width → double?
-
Fixed 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