All I need is my text to be multi-line. Am giving the property of maxLines
but its still getting RenderFlex
overflowed error to the right as the next is not going to 2nd line,
Align( alignment: Alignment.bottomCenter,
child: new ButtonBar(
alignment: MainAxisAlignment.center,
children: <Widget>[
Padding(
padding: EdgeInsets.all(20.0),
child: new Text(
"This is a very bigggggggg text !!!",textDirection: TextDirection.ltr,
style: new TextStyle(fontSize: 20.0, color: Colors.white),
maxLines: 2,
),
)
],
),
)
try this:
in my implementation I put this inside a row and surrounded it with sized boxes on each side so that I have some space between my elements, why using expanded you may ask, well it's used to take as much space as possible so the text would look good in portrait or landscape mode.
and here is a full example on how to make it even react vertically not just horizontally:
Maybe try using
TextField
:Just wrap your text widget with Expended as below
You can use this trick. Text( ''' This is very big text''' ), Just wrap a text around three single quotes and flutter will format a text as per its length . No need to use max lines and text field.
I think you forgot to add
overflow
type.You can use something like this:
Make sure that the parent widget limits your text's width, and then use overflow and maxlines, e.g.: