StoryDocument class

Every edit of one story. Immutable; the editor replaces it on each change and keeps snapshots for undo/redo.

All geometry is in 1080×1920 canvas units (see StoryCanvas).

Annotations

Constructors

StoryDocument({required StoryMedia media, MediaPlacement placement = const MediaPlacement(), StoryBackground background = const StoryBackground(), String? filterId, List<StoryOverlay> overlays = const [], List<DrawingStroke> strokes = const [], TrimRange? trim, double originalVolume = 1, MusicSelection? music})
Creates a document.
const

Properties

background → StoryBackground
Background around the media.
final
exportsVideo → bool
Whether the export is a video (source video, or photo with music).
no setter
filterId → String?
Selected StoryFilter.id; null for none.
final
hashCode → int
The hash code for this object.
no setteroverride
media → StoryMedia
Source photo or video.
final
music → MusicSelection?
Music, if any.
final
originalVolume → double
Volume of the video's own audio, 0–1.
final
outputDuration → Duration?
Length of the exported video, or null for a photo story.
no setter
outputType → StoryMediaType
Output media type.
no setter
overlays → List<StoryOverlay>
Text, sticker and emoji overlays, bottom to top.
final
placement → MediaPlacement
Media placement on the canvas.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
strokes → List<DrawingStroke>
Freehand strokes in drawing order. Drawn above the media and below the overlays.
final
trim → TrimRange?
Kept part of a video; null keeps all of it (only valid when it fits the maximum duration).
final

Methods

copyWith({StoryMedia? media, MediaPlacement? placement, StoryBackground? background, String? filterId, List<StoryOverlay>? overlays, List<DrawingStroke>? strokes, TrimRange? trim, double? originalVolume, MusicSelection? music, bool clearFilter = false, bool clearTrim = false, bool clearMusic = false}) → StoryDocument
Returns a copy with the given values replaced. Use clearFilter, clearTrim and clearMusic to set those to null.
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