Flutter Text not going on a new line in the correct way

54 views Asked by At

My Flutter Text widget is not going on a new line in the way that it should following the spaces between words. What I am expecting is something like:

Non tutti possono diventare dei grandi artisti ma un grande artista può celarsi in chiunque.

But what I'm getting is this:myApp

Here is my problematic code:

class HomePageBodyState extends State<HomePageBody>
{
  @override
  Widget build(BuildContext context)
  {
    return ListView(
      padding: EdgeInsets.all(8),
      children: [
        Column(
          children: [
            Container(
              padding: EdgeInsets.only(left: 20, right: 20, top: 10, bottom: 4),
              child:
                Text(
                  ' Non tutti possono diventare dei grandi artisti ma un grande artista può celarsi in chiunque. ',
                  softWrap: true,
                  textAlign: TextAlign.center,
                  style: TextStyle(
                  fontFamily: "Glass",
                  fontSize: 26,
                  ),
              ),
            ),
          ],
        ),
      );
  }
2

There are 2 answers

0
Akhil George On

You can align the text to the start by changing the textAlign property to TextAlign.start This will align your text to the start of the container.

           Text(
                ' Non tutti possono diventare dei grandi artisti ma un grande artista può celarsi in chiunque.',
                softWrap: true,
                textAlign: TextAlign.start,
                style: TextStyle(
                fontFamily: "Glass",
                fontSize: 26,
                ),
              )
0
Ozan Taskiran On

You center the text with this line:

          textAlign: TextAlign.center,

Remove this, if the text should start on the left.