Video class final

The root of a composition: scenes in, one video out.

A Video computes its total duration from its scenes — you never sum anything. Every scene stays mounted in one shared, expanding Stack under a TransitionCompositor that shows each scene only during its frame window and blends adjacent scenes across their boundaries, with a SceneScope at the scene's running offset giving everything inside the right time scope. The same shared offset math backs totalFrames, sceneStartFrames, and the compositor, so the widget tree and the timing resolver can never disagree on scene boundaries.

The State owns the composition registrar: every animated element under the video registers itself during the first build, a post-frame pass resolves the whole plan once, and the next pump renders every element from its injected schedule — cross-element and scene/video Defaults cascading included.

transition is the video-wide default blend between adjacent scenes. Per-scene Scene.enter/Scene.exit override it boundary by boundary; null everywhere means hard cuts. An overlapping transition starts the next scene early and shortens totalFrames.

captions mount as the top scene-spanning overlay: the layer shows the active cue at the current frame, styled and positioned, reading the cues the render shell pre-parsed before frame 0. audio and export are authoring data, carried verbatim and consumed at render: audio by the audio pipeline and export by the export dispatch.

Inheritance
Available extensions

Constructors

Video({required List<Scene> scenes, VideoSize? size, int width = 1080, int height = 1920, int fps = VideoDefaults.fps, Defaults? motionDefaults, Transition? transition, List<Audio> audio = const [], Captions? captions, Export? export, Time? poster, Key? key})
Creates a video of scenes on a size (or width × height) canvas at fps.

Properties

audio List<Audio>
Composition-wide audio tracks — authoring data the audio pipeline mounts at render.
final
captions Captions?
The caption track, or null for none. When set, the shell mounts a caption layer above the composition that shows the active cue per frame.
final
export Export?
What the render should produce — config data the export pipeline dispatches on; carried verbatim until then.
final
fps int
Frames per second of the whole composition.
final
hashCode int
The hash code for this object.
no setterinherited
height int
The canvas height in pixels; size wins when both are given.
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
motionDefaults Defaults?
Video-level animation defaults — the bottom of the user cascade; null falls through to the package defaults.
final
poster Time?
Which frame is the thumbnail; null means frame zero. Lesson goldens and the inspector read this.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
scenes List<Scene>
The scenes, played back-to-back in declaration order. Never empty.
final
sceneStartFrames List<int>
The frame each scene starts on, in scene order, via the shared layout math; the first is always 0. An overlapping transition starts the next scene early.
no setter
size VideoSize?
The canvas preset, or null when width/height are given loose.
final
totalFrames int
The total length of the video in frames, computed via the shared layout math: the sum of scene durations minus every overlapping transition window.
no setter
transition Transition?
The default scene-to-scene blend, or null for hard cuts.
final
width int
The canvas width in pixels; size wins when both are given.
final

Methods

animate(List<Animation> animations, {Anchor? anchor, TimeRange? window, Defaults? defaults}) Widget

Available on Widget, provided by the Animate extension

Binds animations to this widget by wrapping it in a MotionTarget.
createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() State<Video>
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
show({Time? from, Time? to}) Widget

Available on Widget, provided by the Animate extension

Visibility-window sugar: animate([], window: from.to(to)) with from defaulting to the window start and to to its end.
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