VideoEffectPreview class

Shows child with effects applied, the way an export renders them.

child is usually the video player. For every position the preview draws the same frame of each effect the native renderer draws at that time, so what the preview shows is what the file will contain.

The preview needs Impeller: on another backend, or while the shaders are still loading, child is shown unchanged. The effects still apply to the export. Check isSupported to tell the user.

A glow is screened over child through a BackdropFilter, blurred with Flutter's own Gaussian, which stays close to the export's blur but not pixel-exact. It glows from whatever is painted within the preview's bounds, so a child that leaves some of them transparent lets what lies behind it glow too; give it the video's aspect ratio.

VideoEffectPreview(
  effects: const [VideoEffect.vhs(intensity: 0.6)],
  position: playbackPosition,
  child: videoPlayer,
)
Inheritance

Constructors

VideoEffectPreview({Key? key, required List<VideoEffect> effects, required ValueListenable<Duration> position, required Widget child})
Creates a preview of effects over child.
const

Properties

child → Widget
The widget the effects are applied to.
final
effects → List<VideoEffect>
The effects to show, with their time ranges on the same timeline as position.
final
hashCode → int
The hash code for this object.
no setterinherited
key → Key?
Controls how one widget replaces another widget in the tree.
finalinherited
position → ValueListenable<Duration>
The playhead. Animated effects advance as it moves.
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<VideoEffectPreview>
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

Static Properties

isSupported → bool
Whether this renderer can show the preview.
no setter

Static Methods

precache() → Future<bool>
Loads the preview shaders ahead of the first preview, so the first frames do not show the video without its effect. Safe to call repeatedly.