LoadingWidget class

A highly customizable loading widget that displays a shimmer effect with animated text.

Inheritance

Constructors

LoadingWidget({Key? key, List<String> texts = const ['Loading...'], Duration interval = const Duration(seconds: 2), TextStyle? textStyle, Color? shimmerBaseColor, Color? shimmerHighlightColor, EdgeInsetsGeometry? margin, EdgeInsetsGeometry? padding, BoxDecoration? containerDecoration, Color? backgroundColor, BorderRadius? borderRadius, BoxBorder? border, List<BoxShadow>? boxShadow, double? elevation, List<Color>? gradientColors, List<double>? gradientStops, GradientType gradientType = GradientType.linear, double gradientAngle = 0, bool isGlassmorphic = false, double blurStrength = 10, double glassmorphicOpacity = 0.1, Alignment? alignment, double? width, double? minWidth, double? maxWidth, double? height, double? minHeight, double? maxHeight})
Creates a loading widget with extensive customization options.
const

Properties

alignment → Alignment?
Alignment of the text within the container. If null, aligns based on the text direction (start alignment).
final
backgroundColor → Color?
Background color of the container (ignored if containerDecoration is provided).
final
blurStrength → double
Blur strength for glassmorphic effect.
final
border → BoxBorder?
Border of the container (ignored if containerDecoration is provided).
final
borderRadius → BorderRadius?
Border radius of the container (ignored if containerDecoration is provided).
final
boxShadow → List<BoxShadow>?
Box shadow of the container (ignored if containerDecoration is provided).
final
containerDecoration → BoxDecoration?
Custom decoration for the container, overrides other decoration properties if provided.
final
elevation → double?
Material elevation of the container (if > 0, adds a shadow).
final
glassmorphicOpacity → double
Opacity for the glassmorphic effect (0.0-1.0).
final
gradientAngle → double
Angle for linear gradient in degrees (0-360).
final
gradientColors → List<Color>?
Gradient colors for the background (ignored if containerDecoration is provided).
final
gradientStops → List<double>?
Gradient stops for the gradient colors (should match gradientColors.length).
final
gradientType → GradientType
Type of gradient to apply (linear, radial, or sweep).
final
hashCode → int
The hash code for this object.
no setterinherited
height → double?
Explicit height of the container.
final
interval → Duration
The interval between text changes.
final
isGlassmorphic → bool
Whether to apply a glassmorphic effect.
final
key → Key?
Controls how one widget replaces another widget in the tree.
finalinherited
margin → EdgeInsetsGeometry?
Margin around the loading widget.
final
maxHeight → double?
Maximum height constraint.
final
maxWidth → double?
Maximum width constraint.
final
minHeight → double?
Minimum height constraint.
final
minWidth → double?
Minimum width constraint.
final
padding → EdgeInsetsGeometry?
Padding inside the loading widget container.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
shimmerBaseColor → Color?
The base color for the shimmer effect.
final
shimmerHighlightColor → Color?
The highlight color for the shimmer effect.
final
texts → List<String>
The list of texts to cycle through.
final
textStyle → TextStyle?
The text style for the loading text.
final
width → double?
Explicit width of the container.
final

Methods

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