Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hide overflow flutter, without overflowed message

I have an animation that I want to be partially visible.

enter image description here

Basically the end of the screen should cut the animation in half. So the animation is overflowing but that's intended. How do I remove the overflowed message then ?

return ClipRect(
  child: Container(
    width: MediaQuery.of(context).size.width - 32,
    child: Padding(
      padding: const EdgeInsets.fromLTRB(spacingM, spacingM, 0, spacingM),
      child: Row(
        mainAxisAlignment: MainAxisAlignment.spaceBetween,
        children: [
          TextInfo(
              location: location, dateFormatter: dateFormatter, date: date),
          Transform.translate(
            offset: Offset(30, 0),
            child: WeatherAnimation(),
          ),
        ],
      ),
    ),
  ),
);
like image 538
Ced Avatar asked Oct 17 '25 16:10

Ced


1 Answers

Try using wrapping what is overflowing with a FittedBox. This will clip out what is overflowing.

In this scenario, I believe you should wrap the Padding widget or perhaps the Row widget with FittedBox which would allow the FittedBox to take shape of its parent and clip the children to fit.

like image 138
Harry Avatar answered Oct 21 '25 18:10

Harry



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!