ExpandingTwoHalvesArcLoader class
A custom Flutter widget that displays a rotating loading indicator with two expanding arcs in contrasting colors.
The ExpandingTwoHalvesArcLoader
widget animates two arcs that rotate continuously while expanding and contracting
to create a dynamic loading effect. The widget supports customizable properties for size, stroke width, colors,
rotation speed, and expansion speed.
Key properties include:
size
: The diameter of the loader in logical pixels.strokeWidth
: The width of each arc's stroke, which should be less than one-third of the size.color1
andcolor2
: Colors for each of the two arcs.rotationDurationMs
: Duration of one full rotation cycle in milliseconds (minimum of 500).expansionDurationMs
: Duration of one full expansion and contraction cycle in milliseconds (minimum of 500).
This widget uses two AnimationController
s:
- One for the rotation animation, which rotates the arcs indefinitely.
- One for the expansion animation, which expands and contracts the arcs in a repeating pattern.
The DualArcPainter
class is used to paint the arcs onto the canvas, where each arc's angle and sweep are
controlled by the expansion value.
Usage example:
ExpandingTwoHalvesArcLoader(
size: 48.0,
strokeWidth: 5.0,
color1: Colors.blue,
color2: Colors.red,
rotationDurationMs: 1000,
expansionDurationMs: 2000,
)
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- ExpandingTwoHalvesArcLoader
Constructors
Properties
- color1 → Color
-
final
- color2 → Color
-
final
- expansionDurationMs → int
-
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- rotationDurationMs → int
-
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- size → double
-
final
- strokeWidth → double
-
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< ExpandingTwoHalvesArcLoader> -
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