I have a VideoPlayer widget that needs to be fullscreen and also fit the aspect ratio of the source video. In order to achieve that, I\'ll need to chop off either the top/bo
I had a lot of problems with this, and the accepted answer didn't solve it for me. I was just trying to get a background image to fit vertically and overflow horizontally. Here's how I ended up doing it:
OverflowBox(
maxWidth: double.infinity,
alignment: Alignment.center,
child:
Row(crossAxisAlignment: CrossAxisAlignment.stretch, children: [
UnconstrainedBox(
constrainedAxis: Axis.vertical,
child: Image.asset('images/menu_photo_1.jpg', fit: BoxFit.cover))
])
)