Skip to content
On this page

VideoPlayer

A video playback surface with media controls.

VideoPlayer in FluttyUIVideoPlayer in FluttyUI dark theme

Import

import 'package:flutter/widgets.dart';
import 'package:fluttyui/fluttyui.dart' as ui;

API Reference

The declarations below match the current FluttyUI source. Types are shown without the optional ui. import prefix.

VideoPlayer

const VideoPlayer({
  super.key,
  required this.controller,
  this.title,
  this.poster,
  this.aspectRatio,
  this.fit = BoxFit.contain,
  this.borderRadius = 24,
  this.showControls = true,
  this.allowFullscreen = true,
  this.controlsHideDelay = const Duration(seconds: 2),
  this.showSeekButtons = false,
  this.showSeekPreview = false,
  this.onScrubbingChanged,
  this.ambientGlow = false,
  this.orientationsAfterFullscreen = const [],
});
ParameterTypeRequiredDefault
keyKey?Nonull
controllerbackend.VideoPlayerController?Yes—
titleString?Nonull
posterWidget?Nonull
aspectRatiodouble?Nonull
fitBoxFitNoBoxFit.contain
borderRadiusdoubleNo24
showControlsboolNotrue
allowFullscreenboolNotrue
controlsHideDelayDurationNoconst Duration(seconds: 2)
showSeekButtonsboolNofalse
showSeekPreviewboolNofalse
onScrubbingChangedValueChanged<bool>?Nonull
ambientGlowboolNofalse
orientationsAfterFullscreenList<DeviceOrientation>Noconst []

VideoPlayer.network

const VideoPlayer.network(
  this.url, {
  super.key,
  this.title,
  this.poster,
  this.aspectRatio,
  this.fit = BoxFit.contain,
  this.borderRadius = 24,
  this.showControls = true,
  this.allowFullscreen = true,
  this.controlsHideDelay = const Duration(seconds: 2),
  this.showSeekButtons = false,
  this.showSeekPreview = false,
  this.onScrubbingChanged,
  this.ambientGlow = false,
  this.orientationsAfterFullscreen = const [],
  this.autoplay = false,
  this.looping = false,
  this.muted = false,
  this.httpHeaders = const {},
});

VideoPlayer.asset

const VideoPlayer.asset(
  this.asset, {
  super.key,
  this.package,
  this.title,
  this.poster,
  this.aspectRatio,
  this.fit = BoxFit.contain,
  this.borderRadius = 24,
  this.showControls = true,
  this.allowFullscreen = true,
  this.controlsHideDelay = const Duration(seconds: 2),
  this.showSeekButtons = false,
  this.showSeekPreview = false,
  this.onScrubbingChanged,
  this.ambientGlow = false,
  this.orientationsAfterFullscreen = const [],
  this.autoplay = false,
  this.looping = false,
  this.muted = false,
});

Application Setup

Place components under FluttyApp to provide theme, navigation, localization, and overlay defaults. Use theme tokens for shared appearance settings.

Source

lib/src/widgets/media/video_player/video_player.dart

This reference is generated from the VideoPlayer declaration in the FluttyUI core checkout. The component catalog lists the other available building blocks.

DartFlutter

Get started with FluttyUI