'Flutter VideoPlayer - Cover / Center Crop inside a Widget ( Not Screen )

I have a list view with widgets. I would like to add video players inside those widgets but it should be cover or center crop.

Any solution or suggestions?

Thank you.



Solution 1:[1]

This is what I've figured out so far :

          AspectRatio(
            aspectRatio: 1,
            child: ClipRRect(
              child: AspectRatio(
                aspectRatio: _videoPlayerController.value.aspectRatio,
                child: Center(
                  child: VideoPlayer(_videoPlayerController),
                ),
              ),
            ),
          ),

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Technical Radar