import 'package:better_player/better_player.dart'; import 'package:flutter/material.dart'; import 'package:teso/Classes/Firebase/Posts.dart'; const ASPECT_RATIO = 16 / 9; class VideoPlayerWidget extends StatefulWidget { final BetterPlayerController controller; final FBPosts ad; const VideoPlayerWidget({ Key key, @required this.controller, @required this.ad, }) : assert(controller != null), assert(ad != null), super(key: key); @override _VideoPlayerWidgetState createState() => _VideoPlayerWidgetState(); } class _VideoPlayerWidgetState extends State { @override void initState() { super.initState(); } @override Widget build(BuildContext context) { return FittedBox( clipBehavior: Clip.hardEdge, child: SizedBox( width: MediaQuery.of(context).size.width, height: MediaQuery.of(context).size.height, child: BetterPlayer( controller: widget.controller, ), ), ); } @override void dispose() { widget.controller.dispose(); super.dispose(); } }