SpinnerController class

A ValueNotifier that cycles through Spinner.frames on a periodic timer.

final controller = SpinnerController(Spinners.scanner());

// In build:
ValueListenableBuilder<String>(
  valueListenable: controller,
  builder: (context, frame, _) => Text(frame),
)
Inheritance

Constructors

SpinnerController(Spinner spinner, {bool autoStart = true})
Creates a controller that animates spinner.

Properties

hashCode int
The hash code for this object.
no setterinherited
hasListeners bool
Whether any listeners are currently registered.
no setterinherited
isRunning bool
Whether the animation is currently running.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
spinner Spinner
The spinner animation being driven.
final
value String
The current value held by this object.
getter/setter pairinherited

Methods

addListener(void listener()) → void
Register listener to be called when the object notifies.
inherited
dispose() → void
Releases all listeners. After this call the notifier should not be used.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
notifyListeners() → void
Notify all registered listeners.
inherited
removeListener(void listener()) → void
Remove a previously registered listener.
inherited
start() → void
Starts or restarts the animation from the first frame.
stop() → void
Stops the animation.
throwIfDisposed() → void
Throws StateError if this notifier has already been disposed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited