GlassAnimatedButton class

A stylish, animated button with a frosted glass (glassmorphism) effect.

This widget supports blur, scaling animation on tap, optional icons, customizable text styling, and rounded corners.

Inheritance

Constructors

GlassAnimatedButton({Key? key, required String text, required VoidCallback onPressed, double blur = 10.0, double borderRadius = 16.0, Color color = Colors.white24, TextStyle? textStyle, EdgeInsetsGeometry padding = const EdgeInsets.symmetric(horizontal: 24, vertical: 14), Widget? icon, Duration animationDuration = const Duration(milliseconds: 100), Curve animationCurve = Curves.easeOut, bool isLoading = false, bool isDisabled = false, List<BoxShadow>? boxShadow, Gradient? gradient, bool enableHapticFeedback = false, ImageProvider<Object>? backgroundImage})
Creates a GlassAnimatedButton with customizable glass effect and animation.
const

Properties

animationCurve Curve
The curve of the tap animation.
final
animationDuration Duration
The duration of the tap animation.
final
backgroundImage ImageProvider<Object>?
Optional background image for the button (asset, network, etc.).
final
blur double
The intensity of the blur effect.
final
borderRadius double
The border radius of the button's corners.
final
boxShadow List<BoxShadow>?
Optional shadow or glow effect for the button.
final
color Color
The semi-transparent background color of the button.
final
enableHapticFeedback bool
Whether to enable haptic feedback on tap.
final
gradient Gradient?
Optional gradient background for the button. Overrides color if provided.
final
hashCode int
The hash code for this object.
no setterinherited
icon Widget?
Optional icon displayed before the text.
final
isDisabled bool
Whether the button is disabled.
final
isLoading bool
Whether the button is in a loading state.
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
onPressed VoidCallback
Called when the button is tapped.
final
padding EdgeInsetsGeometry
Padding around the button content (icon and text).
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
text String
The text displayed inside the button.
final
textStyle TextStyle?
Custom text style for the button label.
final

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() State<GlassAnimatedButton>
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