Calls its callback once per animation frame.
When created, a ticker is initially disabled. Call start to enable the ticker.
A Ticker can be silenced by setting muted to true. While silenced, time still elapses, and start and stop can still be called, but no callbacks are called.
By convention, the start and stop methods are used by the ticker's consumer, and the muted property is controlled by the TickerProvider that created the ticker.
Tickers are driven by the SchedulerBinding. See SchedulerBinding.scheduleFrameCallback.
Constructors
- Ticker(TickerCallback _onTick, { String debugLabel })
-
Creates a ticker that will call
onTick
once per frame while running.
Properties
- debugLabel → String
-
read-only
- isActive → bool
-
Whether time is elapsing for this
Ticker
. Becomes true whenstart
is called and false whenstop
is called.read-only - isTicking → bool
-
Whether this
Ticker
has scheduled a call to call its callback on the next frame.read-only - muted → bool
-
Whether this ticker has been silenced.
read / write - scheduled → bool
-
Whether this
Ticker
has already scheduled a frame callback.read-only - shouldScheduleTick → bool
-
Whether a tick should be scheduled.
read-only - hashCode → int
-
Get a hash code for this object.
read-only, inherited - runtimeType → Type
-
A representation of the runtime type of the object.
read-only, inherited
Operators
-
operator ==(
other) → bool -
The equality operator.
inherited
Methods
-
absorbTicker(
Ticker originalTicker) → void -
Makes this Ticker take the state of another ticker, and disposes the other ticker.
-
dispose(
) → void -
Release the resources used by this object. The object is no longer usable after this method is called.
-
scheduleTick(
{bool rescheduling: false }) → void -
Schedules a tick for the next frame.
-
start(
) → Future<Null> -
Starts the clock for this Ticker. If the ticker is not muted, then this also starts calling the ticker's callback once per animation frame.
-
stop(
) → void -
Stops calling this Ticker's callback.
-
toString(
{bool debugIncludeStack: false }) → String -
Returns a string representation of this object.
-
unscheduleTick(
) → void -
Cancels the frame callback that was requested by scheduleTick, if any.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a non-existent method or property is accessed.
inherited