GlassSkeletonLoader class
A shimmering placeholder block for loading states, in the glass aesthetic.
A translucent glass-tinted panel with a soft highlight band that sweeps across it continuously. Use the named constructors for common shapes, or the default constructor for a custom rectangle:
// A block of placeholder text lines
Column(
children: [
GlassSkeletonLoader.text(width: 200),
const SizedBox(height: 8),
GlassSkeletonLoader.text(width: 140),
],
)
// A placeholder avatar
GlassSkeletonLoader.circle(diameter: 48)
// A custom placeholder card
GlassSkeletonLoader(width: double.infinity, height: 120, borderRadius: 16)
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- GlassSkeletonLoader
Constructors
- GlassSkeletonLoader({Key? key, double? width, double height = 16, double borderRadius = 8, Color? baseColor, Color? highlightColor, Duration duration = const Duration(milliseconds: 1400)})
-
Creates a rectangular skeleton placeholder.
const
- GlassSkeletonLoader.circle({Key? key, required double diameter, Color? baseColor, Color? highlightColor, Duration duration = const Duration(milliseconds: 1400)})
-
Creates a circular placeholder (e.g. for an avatar).
const
- GlassSkeletonLoader.text({Key? key, double? width, double height = 14, Color? baseColor, Color? highlightColor, Duration duration = const Duration(milliseconds: 1400)})
-
Creates a single placeholder text line — a short, fully-rounded bar.
const
Properties
- baseColor → Color?
-
Base fill color. Defaults to a theme-aware translucent grey.
final
- borderRadius → double
-
Corner radius (ignored for GlassSkeletonLoader.circle).
final
- duration → Duration
-
Duration of one full sweep of the highlight band.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- height → double
-
Height of the placeholder.
final
- highlightColor → Color?
-
Color of the sweeping highlight band. Defaults to a lighter translucent
grey/white, adapting to light/dark mode.
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- width → double?
-
Width of the placeholder. Null fills the available width.
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< GlassSkeletonLoader> -
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