LiquidGlassButton class
A pressable glass-effect button.
Wraps any child in the Liquid Glass surface and handles tap, scale feedback, and an optional loading state.
LiquidGlassButton(
onPressed: () => print('tapped'),
child: Text('Get Started'),
)
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- LiquidGlassButton
Constructors
- LiquidGlassButton({Key? key, required Widget child, VoidCallback? onPressed, LiquidGlassSettings? settings, BorderRadius borderRadius = const BorderRadius.all(Radius.circular(16)), EdgeInsetsGeometry padding = const EdgeInsets.symmetric(horizontal: 24, vertical: 14), bool isLoading = false, double pressScaleFactor = 0.96, Duration animationDuration = const Duration(milliseconds: 120)})
-
Creates an interactive glass button.
const
Properties
- animationDuration → Duration
-
Duration of the press and release scale animation.
final
- borderRadius → BorderRadius
-
Shape of the glass surface and its clipping boundary.
final
- child → Widget
-
Content displayed when isLoading is false.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- isLoading → bool
-
Whether to show a CircularProgressIndicator instead of child.
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- onPressed → VoidCallback?
-
Called after a successful tap.
final
- padding → EdgeInsetsGeometry
-
Space between the glass edge and child.
final
- pressScaleFactor → double
-
Scale applied while pressed, normally between
0.0and1.0.final - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- settings → LiquidGlassSettings
-
The locally supplied settings, or LiquidGlassSettings.matteLight when
no local settings were supplied.
no setter
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< LiquidGlassButton> -
Creates the mutable state for this widget at a given location in the tree.
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
-
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