ui_kit library

UI 套件与界面定制入口:内置 UI 套件、组件、插槽、作用域、视图交互态和样式。 与 mova.dart 中的兼容导出引用同一声明,可与主入口按需组合。

Classes

IMovaUiKit
A pluggable player "UI kit": decides which MovaComponents exist and how the resulting MovaSlotBundle plus the raw video surface are stacked into the final widget tree.
MovaBackToLiveComponent
Button returning playback to the live edge.
MovaBilibiliUiKit
A ready-to-use bilibili-style VOD UI kit: MovaDefaultUiKit plus a MovaDanmakuTrackComponent and a top-bar MovaSpeedButtonComponent.
MovaBottomBarComponent
Adaptive composite for the bottom control bar, serving both VOD and live from one static node. It exposes the union of both layouts' children in a fixed order (so patch paths never shift) and lays out only the ones relevant to the current MovaState.type — the rest are simply not placed, and thus never mounted.
MovaBrightnessHudComponent
Brightness HUD; visible only while MovaUiState.hud is MovaHud.brightness.
MovaBufferingComponent
Buffering spinner overlay; shown only while MovaState.buffering is true.
MovaBuiltChild
A built child carrying both its addressing name and layout role.
MovaCenterPlayComponent
Composite component for the center overlay: currently only the play/pause tap-feedback button, matching 0.1.0's _centerPlayPause().
MovaChrome
一个播放器视图自己的控制条、HUD、拖动与预览交互态。
MovaComponent
A single addressable node in the player's component tree.
MovaDanmakuStyle
弹幕展示样式;开关与条目仍来自旧配置。
MovaDanmakuTrackComponent
bilibili-style scrolling-danmaku overlay; renders nothing when MovaDanmakuOpts.enabled is off or MovaDanmakuOpts.items is empty.
MovaDefaultUiKit
The built-in IMovaUiKit: reproduces 0.1.0's default look for both VOD and live sources, extended with the new buffering/error/lock overlays that 0.1.0 never had.
MovaDouyinGestureLayerComponent
Gesture layer for the douyin-style feed UI kit: single tap toggles play/pause, double tap toggles the local like state and flashes a heart burst — deliberately does not mount any drag-based volume/brightness/seek gesture (see doc/SPEC.md's feed entry): the vertical drag is owned by the feed's PageView, and simply never registering a competing gesture recognizer here is how mova's component architecture avoids the conflict without special-casing it.
MovaDouyinUiKit
A fully custom (③-tier, see doc/DESIGN-0.3.0-plugin-ui-kit.md §7.1) UI kit for one page of a MovaFeed-driven vertical feed: no top bar, no seek bar, full-bleed video, a right-side social rail, and bottom author/music info — douyin-style.
MovaDurationLabelComponent
Total-duration label; reads MovaState.duration.
MovaErrorComponent
Playback-error overlay; shown whenever MovaState.error is non-null, with the error's text and a retry button that calls IMovaApi.reload.
MovaFitButtonComponent
Fit-mode cycling button; label reflects IMovaApi.options's configured MovaStrs, tap cycles MovaFit.contain → cover → fill → contain.
MovaFullscreenButtonComponent
Fullscreen toggle button; icon flips between enter/exit fullscreen glyphs based on MovaState.fullscreen.
MovaGestureLayerComponent
Component that recognizes gestures on the video surface (drag/pinch/tap) and drives the matching IMovaApi intent — never touching playback state directly. Which action each direction performs is configurable via MovaGestureOpts (side↔action mapping); defaults follow the mainstream convention (left = brightness, right = volume, horizontal = seek). Seek is gated by liveSeekable/allowWhenLive for live sources.
MovaGradBar
A translucent top/bottom gradient bar host that does not absorb pointer events on its empty regions (so center gestures fall through).
MovaHudLayerComponent
Composite component that hosts the 4 transient HUD overlays (volume, brightness, seek, zoom) and shows whichever one matches the current MovaUiState.hud — mirroring 0.1.0's single-HUD-at-a-time behaviour.
MovaIconButton
A compact themed icon button used across the control bars.
MovaIcons
播放器控制界面的图标集合;默认图标与旧界面一致,社交按钮不在本集合中。 通过 MovaPlayerStyle.icons 配置,各节整体替换。 示例:MovaIcons(pip: Icons.open_in_new)。
MovaLiveBadgeComponent
The live/time-shift badge: a red LIVE pill at the edge, a muted 时移 pill while replaying. Nested under MovaBottomBarComponent in live mode.
MovaLockMaskComponent
Full-size tap-swallowing mask shown while MovaState.locked is true.
MovaLockToggleComponent
可通过 lockToggle 路径替换或移除的锁定按钮;解锁入口保持可达。
MovaMinimalUiKit
A chrome-free UI kit: just the picture plus an optional buffering spinner (and optionally the error overlay). No gesture layer, no bars — taps fall through to whatever wraps the player. For preview cards, live tiles and backgrounds.
MovaNextUpComponent
"Next up" card that fades in near the end of the current playlist item and offers a one-tap jump to the next one. Renders nothing when the playlist is disabled, there is no next item, or the host dismissed it for this item.
MovaOrientButtonComponent
Forced-orientation toggle button; tap switches the device between forced landscape and portrait via IMovaApi.setOrient, independent of fullscreen.
MovaPatch
A pending mutation to apply to a component tree via applyPatches.
MovaPatchAdd
See MovaPatch.add.
MovaPatchInsertAfter
See MovaPatch.insertAfter.
MovaPatchRemove
See MovaPatch.remove.
MovaPatchReplace
See MovaPatch.replace.
MovaPipButtonComponent
Picture-in-picture entry button; renders nothing where PiP is unsupported.
MovaPlayerStyle
播放器视图的样式;各节整体替换、独立回落。 优先级:视图参数 > ThemeExtension > 旧 options > 默认值。 图标节没有旧配置,对应回落直接使用默认集合。 切换主题只更新视图,不重建播放器。 示例:MovaPlayerStyle(strings: MovaStrs(live: 'ON AIR'))。
MovaPlayPauseComponent
Large center play/pause tap-feedback button.
MovaPositionLabelComponent
Elapsed-time label; follows IMovaApi.progress's position field.
MovaPreviewComponent
The scrub-preview bubble: a thumbnail plus the target timestamp, floating directly above the seek bar while a drag is in progress.
MovaProgSelect<T>
Rebuilds builder only when the field picked by selector out of the current MovaProg changes.
MovaQualityButtonComponent
Quality-picker button; hides when the current source has no selectable quality variants.
MovaScope
Publishes a IMovaApi instance down the widget tree so descendant widgets (e.g. MovaSelect and friends) can find it without it being threaded through every constructor.
MovaSeekBarComponent
The seek slider; disabled while MovaState.duration is zero (unknown, e.g. live), matching 0.1.0's _bottomBar() guard.
MovaSeekHudComponent
Seek-preview HUD; visible only while MovaUiState.hud is MovaHud.seek.
MovaSelect<T>
Rebuilds builder only when the field picked by selector out of the current MovaState changes.
MovaSheetItem
One selectable row in showMovaOptionSheet: a label, whether it is the currently-active choice (shows a checkmark), and what to do once picked.
MovaSlotBundle
Groups already-built top-level widgets by MovaSlot for a single frame.
MovaSpeedButtonComponent
Playback-rate cycling button; label shows the active multiplier (e.g. 1.5x), tap advances to the next step in _kSpeedSteps, wrapping around.
MovaSubtitleButtonComponent
Subtitle entry button; renders nothing when no STT recognizer is configured (IMovaApi.stt.languages is empty), matching MovaPipButtonComponent's unsupported-capability convention.
MovaSubtitleOverlayComponent
STT subtitle overlay: renders the cue covering the current playback position, or nothing when none does.
MovaTimeshiftLabelComponent
Shows how far behind the live edge playback currently is, as -MM:SS.
MovaTitleComponent
Displays the current source's title, ellipsized to one line.
MovaTopBarComponent
Composite component for the top control bar: title (expanded) followed by pip / quality / fit / fullscreen / lock buttons, matching 0.1.0's _topBar() row order.
MovaUiSelect<T>
Rebuilds builder only when the field picked by selector out of the current MovaUiState changes.
MovaVolumeHudComponent
Volume HUD; visible only while MovaUiState.hud is MovaHud.volume.
MovaZoomHudComponent
Zoom HUD; visible only while MovaUiState.hud is MovaHud.zoom.

Enums

MovaSlot
Named regions of the player overlay that components can be assigned to.

Mixins

MovaPlugin<T extends StatefulWidget>
Capability mixin for stateful components that react to events with side effects (not mere rebuilds — those stay stateless via MovaSelect).

Functions

applyPatches(List<MovaComponent> tree, List<MovaPatch> patches) → List<MovaComponent>
Applies patches to tree and returns a new tree; never mutates the input. An unmatched path asserts in debug and is a no-op in release.
buildSlots(BuildContext context, IMovaApi api, List<MovaComponent> tree) → MovaSlotBundle
Builds every component in tree into widgets and groups the resulting top-level widgets by MovaSlot.
formatDuration(Duration d) → String
Formats a duration as mm:ss (or h:mm:ss when an hour or longer).
movaBoxFit(MovaFit fit) → BoxFit
Maps a MovaFit to the Flutter BoxFit used by the video surface.
showMovaOptionSheet(BuildContext context, MovaTheme theme, List<MovaSheetItem> items) → Future<void>
Shows a themed bottom sheet listing items as checkable rows; tapping a row dismisses the sheet then invokes that row's MovaSheetItem.onSelected.