Reputation: 101
Can anyone explain me how to align the text in the flutter code? My output looks messy and did not look good.
this is the code part for the output
Upvotes: 0
Views: 982
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
Reputation: 1379
child: new Column(
mainAxisAlignment: MainAxisAlignment.start, //To align at start
mainAxisAlignment: MainAxisAlignment.end, //To align at end
children: [
],
);
)
Upvotes: 1