LayerTimelineVisibility class
Controls layer visibility based on Layer.startTime / Layer.endTime relative to the current video time.
The animation progress is derived directly from the video position so that seeking immediately reflects the correct transition state (e.g. seeking to the middle of a 5 s fade-in shows the layer at 50 %).
When Layer.animations is not empty, the transition is phase-aware: each
animation drives a fade, slide, or scale during the layer's enter window
([startTime, startTime + duration]) and/or exit window
([endTime - duration, endTime]). Multiple animations are composed, so the
enter and leave phases can use distinct animation types — something the
single (child, animation) LayerTimelineConfigs.transitionBuilder cannot
express. The slide effect is edge-aware: using canvasSize and
layerCenter it pushes the layer just past the nearest canvas edge (rather
than by its own size), so even an off-center layer leaves the visible area
completely. When Layer.animations is empty, the legacy fade convenience
driven by Layer.enterDuration / Layer.exitDuration and the
LayerTimelineConfigs.transitionBuilder is used instead.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- LayerTimelineVisibility
Constructors
-
LayerTimelineVisibility({Key? key, required Layer layer, required ValueNotifier<
Duration> playTimeNotifier, required LayerTimelineConfigs configs, required Size canvasSize, required Offset layerCenter, required Widget child}) -
Creates a LayerTimelineVisibility.
const
Properties
- canvasSize → Size
-
The size of the editor canvas (in canvas coordinates, origin top-left).
final
- child → Widget
-
The layer widget to show/hide.
final
- configs → LayerTimelineConfigs
-
Animation configuration for the enter/exit transition.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- layer → Layer
-
The layer whose time range is evaluated.
final
- layerCenter → Offset
-
The layer's center in canvas coordinates (origin top-left).
final
-
playTimeNotifier
→ ValueNotifier<
Duration> -
Notifier that provides the current video playback position.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< LayerTimelineVisibility> -
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
-
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