Search code examples
flutterconstraintsoverflowconstrainedbox

How to make ConstrainedBox constrained by its parent in Flutter?


I'm using a TextScroll() inside a ConstrainedBox, but it sometimes overflows beyond the screen limits and I want it to not do that. How can I make the ConstrainedBox constrained by its parent or how do I avoid the screen overflow? Thank you.


Solution

  • To stop overflow you can wrap the text with a flexible widget and/or add overflow : Overflow.elipsis to the text widget