video_editor library

Classes

AiCancelButton
AIController
AiDialogScaffold
AiDialogTextField
AiEditResultSheet
What an AI edit did, what it skipped and why, and the post caption with hashtags ready to copy or share.
AiLanguageDropdown
AiMagicAction
Single AI shortcut shown in AiMagicBar.
AiMagicBar
Horizontally scrollable row of Figma AI magic pills.
AiPrimaryButton
AiSecondaryButton
AiSectionLabel
AppScrubber
Reusable scrubber: track + played portion + thumb, with a mono elapsed/duration timecode row underneath.
AudioController
AutoCaptionCue
A single timed caption cue produced by the AI caption pipeline.
AutoCaptionsDialog
AutoEditor
Carries out an EditPlan on a project with the on-device AI features: silence detection, beat tracking, music synthesis and Whisper captions. Nothing leaves the device and no paid service is used.
AutoEditReport
What an AI edit did, for the summary shown afterwards.
AutoEditSheet
"AI Edit": describe the edit in words (typed or spoken, any language) or pick a trending style, and the editor cuts, styles, captions and even picks the best moments of the project, then writes the post.
BackgroundRemovalDialog
Removes the background of the selected clip, either with on-device person segmentation or a green-screen chroma key, and places the subject over a new colour or image. The processed clip replaces the original in place.
BeatGrid
Tempo and phase of a music track.
BottomTools
Main editor tool bar shown when nothing is selected (CapCut's bottom bar): add media, audio, text, effects, filters, ratio, canvas and AI.
CenterControls
Center rewind / play-or-pause / forward controls.
ClipController
ClipCropSheet
Crop / reframe a clip inside the project's frame: pinch to zoom, drag to move, Fit or Fill, a zoom slider and Reset. Uses the same maths as the preview and the export, so what you frame here is what you get.
ClipTrimSheet
Clip tool: choose a range of the clip's source with two handles, then keep just that range or cut it out of the middle.
ContextualToolbar
Tool strip for the selected timeline item (replaces the main tool bar while something is selected, like CapCut).
DraftSavedScreen
Confirmation shown after a draft is saved successfully.
DraggableTextOverlay
A text overlay on the preview canvas that can be moved with one finger, pinched to scale and rotate with two, or transformed with the corner handle once selected (CapCut style).
DurationBadge
Duration pill, e.g. '00:04.2'.
EditAgent
The AI Edit agent.
EditCommandParser
Turns a plain-language request into an EditPlan. Pure keyword matching, so it works offline and costs nothing.
EditorBody
The editing workspace: AI shortcuts, preview, playback controls, timeline and the tool bar for the current selection.
EditorFeedback
Small static helpers for editor snackbars (Figma feedback copy).
EditorTool
Single tool shown in ContextualToolbar.
EditPlan
Everything an AI edit will do. Built by EditCommandParser and carried out by AutoEditor; null / false means "leave as it is".
EffectController
ExportCompleteScreen
Shown after a successful export with file details and actions.
ExportController
ExportDialog
ExportOverlay
ExportProgressScreen
Progress screen driven by VideoEditorController export state.
ExportSettings
Immutable export configuration chosen on the settings screen.
ExportSettingsScreen
Export settings screen: project summary, option chips, file options.
FaceTrack
A simple face tracking result for AI video analysis.
FinalResultPlayer
Plays an exported video with play/pause, seeking and looping.
FullscreenPlayerScreen
Dark fullscreen player matching the Figma 'Full-screen video player'.
FullscreenPreview
GradientButton
Figma gradient primary button with glow.
LandingPage
Empty-project state: pick a format, then add media.
MediaInfo
What the editor needs to know about an imported video.
MediaProbeService
MediaThumbnail
Placeholder media area: dark card with centered play button, resolution top-left, duration top-right, title bottom-left.
MusicGenerationDialog
MusicSynthesizer
Offline music renderer.
ObjectTrack
A simple object tracking result for AI video analysis.
OpenCutEditorScreen
PlayerTool
Small config model for a player tool item.
PlayerToolsRow
Bottom icon+label tools row.
ProjectCard
Dark project card with thumbnail, draft/duration badges and metadata.
ProjectPreview
ProjectsScreen
AppBar-less Projects screen: brand bar, new-project CTA, search, Drafts / Recent sections and a storage footer row.
ProjectState
ProjectStorage
Saves editor projects as JSON in the app documents directory so drafts survive restarts.
ProjectSummary
Summary data for a single video project on the Projects screen.
RasterizedOverlay
PNG bytes of a rasterized overlay and their pixel size.
RenderFilterBuilder
RenderGraphBuilder
Builds the FFmpeg filter graph for a project.
RenderImageOverlay
A pre-rendered transparent PNG (text overlay or watermark) composited over the video at a normalized centre position for a time range.
RenderJob
Handle used to cancel an in-flight render.
RenderPlan
The FFmpeg arguments that render one project.
ResolutionBadge
Small dark pill badge, e.g. '1080P'.
SaveDraftSheet
Bottom sheet asking whether to keep unsaved edits as a draft.
ShareDestination
Single share destination row.
ShareDestinationsSheet
Bottom sheet listing share destinations. Returns selected label.
SmartAiCard
Smart AI status in the AI Edit sheet: download the free on-device model, watch the progress, switch it on or off, or remove it.
SmartAiModel
The free, open, on-device language model behind "Smart AI".
SmartCutService
Finds the parts of a clip where someone is talking, so the silent gaps can be cut out (the "jump cut" every talking-head reel uses).
StickerSheet
Sticker picker: trending emoji plus any image from the gallery (a PNG with transparency looks like a real sticker). Stickers behave like text: drag, pinch, rotate and trim them on the timeline.
StoredProject
A saved project: its card summary plus the editable state.
StyleTransferDialog
Applies a real colour-grade to the selected clip. The grade is stored on the clip and rendered by the FFmpeg filter graph at export time, so it applies to every frame instead of a single extracted still.
TextController
TextOverlayPaint
Single source of truth for how a VideoTextOverlay looks.
TextOverlayView
Draws a text overlay (without rotation/scale, which the caller applies) for a canvas whose text pixel scale is pixelScale.
TimelineWidgets
CapCut-style multi-track timeline.
TimeRange
A span of media time.
TitleBadge
Bottom-left title pill.
VideoAIService
Coordinates the on-device AI features used by the editor.
VideoAIServiceAudio
Audio AI features for video editing.
VideoAIServiceBase
Owns the on-device ML Kit detectors used by the AI features.
VideoAIServiceCutout
On-device person cut-out ("remove background" without a green screen).
VideoAIServiceUtilities
Utilities for AI-powered video editing features.
VideoAIServiceVideo
Video AI features for video editing.
VideoEditDialog
VideoEditorAudioTrack
VideoEditorClip
VideoEditorColors
Single source of truth for the video_editor package design system.
VideoEditorComponents
Shared button / dialog / sheet styling so screens stay consistent.
VideoEditorController
VideoEditorRadii
Corner radii used across the package.
VideoEditorScreen
VideoEditorSpacing
Spacing scale (multiples of 4).
VideoEditorTextStyles
Reusable text styles used across editor screens, dialogs and sheets.
VideoEditorTheme
Dark theme for the editor experience.
VideoEffectOverlay
VideoEntryScreen
VideoPreviewCard
Figma 'Video preview player' card.
VideoRenderService
VideoTextOverlay
VideoTrimDialog
VoiceGenerationDialog

Enums

AudioCleanup
Clean-up of a clip's own sound, applied inside the render (so it can never drift out of sync with the picture).
ClipTransition
How a clip enters the timeline. Applied at the start of the clip (and a matching fade-out at the end of the clip before it), so it never changes the project length.
DraftAction
Result of the save-draft bottom sheet.
EditTemplate
Ready-made looks modelled on popular Instagram / TikTok edit styles.
EffectSpan
Where a timed effect from AI Edit goes.
ExportFrameRate
Export frame rate options.
ExportQuality
Export quality options.
ExportResolution
Export resolution options.
TextOverlayStyle
Visual treatment applied to a text overlay, shared by the live preview and the export rasterizer so both render identically.
TimelineViewMode
VideoAspectRatio
VideoEditorEffect
VideoFillMode
VideoTrackType

Constants

kTextReferenceShortSide → const double
Reference canvas short side that VideoTextOverlay.fontSize is expressed in. A 64px font covers the same share of the frame on every canvas size.

Functions

captionOverlaysForClip({required List<AutoCaptionCue> cues, required VideoEditorClip clip, required Duration clipProjectStart, required String idPrefix}) → List<VideoTextOverlay>
Converts cues measured from the start of a clip's trimmed range (file time) into project-time caption overlays for that clip.
defaultDestinations() → List<ShareDestination>
Default destinations shown in the share sheet (Material icons only).
fileBaseName(String path) → String
Last path segment, for both / and \ separated paths.
formatBytes(int bytes) → String
Human-readable file size, e.g. 24.3 MB.
formatDuration(Duration duration) → String
formatTimelineTime(int totalSeconds) → String

Typedefs

RenderProgressCallback = void Function(double progress)
Progress of a render in the range 0..1.
TextGenerator = Future<String> Function(String prompt)
Generates text for a prompt. The editor's AI agent only depends on this, so tests (and other engines later) can supply their own.

Exceptions / Errors

CaptionUnavailableException
Thrown when a video carries no subtitle stream that can be converted into timed caption cues.
RenderCancelledException
Thrown when a render was cancelled through its RenderJob.
RenderException
Thrown when FFmpeg could not render the project.
SegmentationModelUnavailableException
Thrown when person segmentation cannot run (unsupported platform or the on-device model failed to load).
TranscriptionException
Carries a user-readable reason why transcription could not produce cues.