TimelinePlayerState class
An immutable snapshot of NativeTimelinePlayer playback state.
Emitted on NativeTimelinePlayer.stateStream whenever the native layer reports a position update or a play/pause transition.
- Annotations
Constructors
-
TimelinePlayerState({required Duration globalPosition, required int clipIndex, required Duration localPosition, required bool isPlaying, required Duration totalDuration, List<
Duration> clipDurations = const [], bool canUndo = false, bool canRedo = false}) -
Creates a fully-specified TimelinePlayerState.
const
- TimelinePlayerState.fromMap(Map map)
-
factory
- TimelinePlayerState.initial()
-
A zero-position, paused state suitable as an initial value before
load.const
Properties
- canRedo → bool
-
Whether the native edit history currently has a redo snapshot.
final
- canUndo → bool
-
Whether the native edit history currently has an undo snapshot.
final
-
clipDurations
→ List<
Duration> -
Resolved duration of each clip in the current timeline, in order.
final
- clipIndex → int
-
Zero-based index of the clip currently playing.
final
- globalPosition → Duration
-
Elapsed playback time measured from the very start of the timeline.
final
- hashCode → int
-
The hash code for this object.
no setteroverride
- isPlaying → bool
-
Whether the player is currently playing (
true) or paused (false).final - localPosition → Duration
-
Elapsed playback time within the current clip.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- totalDuration → Duration
-
Combined duration of all clips in the loaded timeline.
final
Methods
-
copyWith(
{Duration? globalPosition, int? clipIndex, Duration? localPosition, bool? isPlaying, Duration? totalDuration, List< Duration> ? clipDurations, bool? canUndo, bool? canRedo}) → TimelinePlayerState -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override