SkeletonLoader class

A skeleton loading placeholder with shimmer animation.

Supports:

  • Various shapes (rectangle, circle, text lines)
  • Customizable shimmer direction and speed
  • Multiple skeleton presets for common UI elements
Inheritance

Constructors

SkeletonLoader.new({Key? key, double? width, double height = 16, double borderRadius = 8, bool isCircle = false, Duration shimmerDuration = const Duration(milliseconds: 1500), Color? baseColor, Color? highlightColor, bool isLoading = true, EdgeInsetsGeometry? margin})
const
SkeletonLoader.circle({Key? key, required double size, Duration shimmerDuration = const Duration(milliseconds: 1500), Color? baseColor, Color? highlightColor, bool isLoading = true, EdgeInsetsGeometry? margin})
Creates a circular skeleton (avatar placeholder).
factory
SkeletonLoader.text({Key? key, double? width, double height = 14, Duration shimmerDuration = const Duration(milliseconds: 1500), Color? baseColor, Color? highlightColor, bool isLoading = true, EdgeInsetsGeometry? margin})
Creates a text line skeleton.
factory

Properties

baseColor → Color?
Base color of the skeleton.
final
borderRadius → double
Border radius for rounded corners.
final
hashCode → int
The hash code for this object.
no setterinherited
height → double
Height of the skeleton.
final
highlightColor → Color?
Highlight color of the shimmer.
final
isCircle → bool
Whether the skeleton is a circle.
final
isLoading → bool
Whether the shimmer animation is running.
final
key → Key?
Controls how one widget replaces another widget in the tree.
finalinherited
margin → EdgeInsetsGeometry?
Margin around the skeleton.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
shimmerDuration → Duration
Duration of one shimmer cycle.
final
width → double?
Width of the skeleton. Required for non-circle shapes.
final

Methods

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