CustomLoadingIndicator class

A loading indicator that renders image at the center and animates one or more orbiting dots around it.

CustomLoadingIndicator(
  image: AssetImage('assets/logo.png'),
  size: 120,
  orbiters: [
    OrbiterConfig(color: Colors.blue, size: 14),
    OrbiterConfig(color: Colors.red,  size: 10, phaseOffset: 0.5),
  ],
  showOrbitTrack: true,
  pulseImage: true,
)
Inheritance

Constructors

CustomLoadingIndicator({Key? key, required ImageProvider<Object> image, double size = 100.0, EdgeInsets imagePadding = const EdgeInsets.all(20), BoxFit imageFit = BoxFit.contain, BorderRadius? imageRadius, BoxDecoration? imageDecoration, List<OrbiterConfig> orbiters = const [OrbiterConfig()], double orbitRadiusFactor = 0.85, Duration duration = const Duration(seconds: 2), bool clockwise = true, OrbitCurve orbitCurve = OrbitCurve.linear, bool showOrbitTrack = false, Color? orbitTrackColor, double orbitTrackWidth = 1.0, bool pulseImage = false, double pulseScale = 1.08, bool paused = false, VoidCallback? onCycleComplete})
const

Properties

clockwise bool
true for clockwise rotation (default), false for counter-clockwise.
final
duration Duration
Duration of one full orbit. Defaults to 2 s.
final
hashCode int
The hash code for this object.
no setterinherited
image ImageProvider<Object>
The image displayed at the center.
final
imageDecoration BoxDecoration?
Background decoration painted behind the image.
final
imageFit BoxFit
How the image fits its allocated space.
final
imagePadding EdgeInsets
Padding around the image inside the widget bounds.
final
imageRadius BorderRadius?
Clips the image with this border radius (e.g. circular avatar).
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
onCycleComplete VoidCallback?
Fired once per completed orbit cycle.
final
orbitCurve OrbitCurve
Easing applied to the rotation animation.
final
orbiters List<OrbiterConfig>
One or more orbiting dot configurations. Omit to use a single blue circle.
final
orbitRadiusFactor double
Orbit radius as a fraction of size / 2. 1.0 = outer edge, 0.5 = halfway in. Defaults to 0.85.
final
orbitTrackColor Color?
Color of the orbit track. Defaults to Colors.grey at 20% opacity.
final
orbitTrackWidth double
Stroke width of the orbit track. Defaults to 1.
final
paused bool
Pause/resume the animation without removing the widget from the tree.
final
pulseImage bool
Adds a gentle scale-pulse to the central image.
final
pulseScale double
Maximum scale factor during the pulse. 1.0 = no pulse. Defaults to 1.08.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
showOrbitTrack bool
Draws a faint circular guide rail when true.
final
size double
Width and height of the entire widget. Defaults to 100.
final

Methods

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