Search code examples
flutterflutter-layoutflutter-dependenciesflutter-webflutter-animation

how to make flutter video player responsive?


I was trying to make a webpage with a default video playing but in full screen like this it looks fine but when changing size it getting worst. Like this image how to fix this issue like this

class WelcomePage extends StatefulWidget {

VideoPlayerController? _videoCOntroller;

@override
void initState() {
super.initState();
  _videoCOntroller!.initialize().then((value) {
  _videoCOntroller!.play();
  _videoCOntroller!.setLooping(true);
});
}
@override
Widget build(BuildContext context) {
final size = MediaQuery.of(context).size;
return Scaffold(
  body: Column(
    children: [
      Stack(
        children: [
          Container(
            color: Colors.amber,
            height: size.height,
            width: size.width,
            child: FittedBox(
              fit: BoxFit.cover,
              child: Container(
                height: size.height,
                width: size.width,
                child: VideoPlayer(_videoCOntroller!),
              ),
            ),
          
          ),
          Positioned(
            height: size.height,
            width: size.width,
            child: 
                child:
                                        
                           
                               

Solution

  • The problem was using stack inside a column just removing that could fic the issue