StoryMedia class

The source photo or video being edited.

width and height are the display size, i.e. after applying the file's rotation metadata; rotationDegrees is kept for the native export.

Annotations

Constructors

StoryMedia({required String path, required StoryMediaType type, required int width, required int height, required StorySourceKind source, Duration? duration, int rotationDegrees = 0, bool hasAudio = false, bool mirrored = false, String? mimeType})
Creates source media.
const

Properties

aspectRatio → double
Display aspect ratio (width / height).
no setter
duration → Duration?
Video length; null for photos.
final
hasAudio → bool
Whether the video has an audio track.
final
hashCode → int
The hash code for this object.
no setteroverride
height → int
Display height in pixels.
final
isVideo → bool
Whether this is a video.
no setter
mimeType → String?
MIME type, if known.
final
mirrored → bool
Whether the pixels must be flipped horizontally to match what the user saw (front-camera captures on some platforms).
final
path → String
Absolute path of a local, readable file.
final
rotationDegrees → int
Clockwise rotation stored in the file's metadata (0, 90, 180, 270).
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
source → StorySourceKind
Camera or gallery.
final
type → StoryMediaType
Photo or video.
final
width → int
Display width in pixels.
final

Methods

copyWith({String? path, int? width, int? height, Duration? duration, int? rotationDegrees, bool? hasAudio, bool? mirrored}) → StoryMedia
Returns a copy with the given values replaced.
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