VideoBox constructor

const VideoBox({
  1. Key? key,
  2. required VideoController controller,
  3. List<Widget>? children = const <Widget>[],
  4. List<Widget>? beforeChildren = const <Widget>[],
  5. List<Widget>? afterChildren = const <Widget>[],
  6. Widget? background,
  7. Widget? cover,
  8. EdgeInsets? bottomPadding = const EdgeInsets.only(bottom: 10),
  9. ThemeData? theme,
  10. Widget? customLoadingWidget,
  11. Widget? customBufferedWidget,
  12. Color? barrierColor,
  13. BottomViewBuilder? bottomViewBuilder = kBottomViewBuilder,
  14. CustomFullScreen? customFullScreen = const KCustomFullScreen(),
})

Example:

import 'package:video_box/video.controller.dart';
import 'package:video_box/video_box.dart';
import 'package:video_player/video_player.dart';
VideoController vc = VideoController(source: VideoPlayerController.network('xxx.mp4'))..initialize();

@override
void dispose() {
  vc.dispose();
}

// display videoBox
AspectRatio(
  aspectRatio: 16 / 9,
  child: VideoBox(controller: vc),
)

see also:

https://github.com/januwA/flutter_video_box/tree/master/example

Implementation

const VideoBox({
  Key? key,
  required this.controller,
  this.children = const <Widget>[],
  this.beforeChildren = const <Widget>[],
  this.afterChildren = const <Widget>[],
  this.background,
  this.cover,
  this.bottomPadding = const EdgeInsets.only(bottom: 10),
  this.theme,
  this.customLoadingWidget,
  this.customBufferedWidget,
  this.barrierColor,
  this.bottomViewBuilder = kBottomViewBuilder,
  this.customFullScreen = const KCustomFullScreen(),
}) : super(key: key);