You can wrap the Column with Center widget and CrossAxisAlignment to start with MainAxisSize to min.
Example:
@override
Widget build(BuildContext context) {
return Scaffold(
body: Center(
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: const [
Text('This is line one'),
Text('This is line two'),
Text('This is line three'),
Text('This is line four'),
Text('This is line five'),
],
),
),
);
}
2
Answers
You can wrap the
Column
withCenter
widget andCrossAxisAlignment
tostart
withMainAxisSize
tomin
.Example:
Output: