Mohd Azwan
Mohd Azwan

Reputation: 101

How to align the text position in flutter

Can anyone explain me how to align the text in the flutter code? My output looks messy and did not look good.

enter image description here

this is the code part for the output

enter image description here

Upvotes: 0

Views: 982

Answers (2)

JahidRatul
JahidRatul

Reputation: 519

use crossAxisAlignment and mainAxisAlignment to define the position of the children...

Column(
  crossAxisAlignment: CrossAxisAlignment.start,
  mainAxisAlignment: MainAxisAlignment.start,

  children: <Widget>[
    Text('We move under cover and we move as one'),
    Text('Through the night, we have one shot to live another day'),
    Text('We cannot let a stray gunshot give us away'),
    Text('We will fight up close, seize the moment and stay in it'),
    Text('It’s either that or meet the business end of a bayonet'),
    Text('The code word is ‘Rochambeau,’ dig me?'),
    
  ],
)

Upvotes: 1

Bilaal Abdel Hassan
Bilaal Abdel Hassan

Reputation: 1379

child: new Column(
      mainAxisAlignment: MainAxisAlignment.start, //To align at start
      mainAxisAlignment: MainAxisAlignment.end, //To align at end
      children: [

      ],
    );
)

Upvotes: 1

Related Questions