ReplayCursor class
The current position within a game's replay, as an index into replayFramesProvider.
Starts at 0 (the initial frame) so the replay plays forward from the
beginning. frameCount is passed by the screen once the frames have
loaded, so stepping and scrubbing clamp to the valid range without the
controller re-reading the async list. Stepping forward one frame keeps the
underlying version consecutive, which is what lets the game animate the
transition; jumping or stepping back is non-consecutive and snaps.
- Annotations
-
- @riverpod
Constructors
Properties
- frameCount → int
-
no setterinherited
- gameId → String
-
no setterinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- ref → Ref
-
The
Refassociated with this notifier.no setterinherited - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- state ↔ int
-
The value currently exposed by this notifier.
getter/setter pairinherited
- stateOrNull → int?
-
The value currently exposed by this
Notifier.no setterinherited
Methods
-
build(
{required String gameId, required int frameCount}) → int -
jumpTo(
int index) → void - Jumps to an arbitrary frame (e.g. a scrubber drag), clamped to range.
-
listenSelf(
void listener(int? previous, int next), {void onError(Object error, StackTrace stackTrace)?}) → RemoveListener -
Listens to changes on the value exposed by this provider.
inherited
-
next(
) → void - Advances to the next frame, if any. A single forward step animates.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
previous(
) → void - Returns to the previous frame, if any. Snaps (non-consecutive version).
-
runBuild(
) → WhenComplete? -
Executes
Notifier.build.inherited -
toString(
) → String -
A string representation of this object.
inherited
-
updateShouldNotify(
int previous, int next) → bool -
A method invoked when the state exposed by this
Notifierchanges. It compares the previous and new value, and return whether listeners should be notified.inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited