VideoBox constructor
const
VideoBox({
- Key? key,
- required VideoController controller,
- List<
Widget> ? children = const <Widget>[], - List<
Widget> ? beforeChildren = const <Widget>[], - List<
Widget> ? afterChildren = const <Widget>[], - Widget? background,
- Widget? cover,
- EdgeInsets? bottomPadding = const EdgeInsets.only(bottom: 10),
- ThemeData? theme,
- Widget? customLoadingWidget,
- Widget? customBufferedWidget,
- Color? barrierColor,
- BottomViewBuilder? bottomViewBuilder = kBottomViewBuilder,
- 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);