Complete the code to create a vertical layout using Flutter's widget.
Column(
children: [
Text('Hello'),
Text('World'),
],
mainAxisAlignment: [1],
)The mainAxisAlignment property controls vertical alignment in a Column. Using MainAxisAlignment.center centers the children vertically.
Complete the code to create a horizontal layout with evenly spaced children.
Row(
mainAxisAlignment: [1],
children: [
Icon(Icons.star),
Icon(Icons.star),
Icon(Icons.star),
],
)MainAxisAlignment.spaceEvenly places equal space between all children and edges in a Row, creating an even horizontal layout.
Fix the error in the code to align children to the start of the cross axis in a Column.
Column( crossAxisAlignment: [1], children: [ Text('One'), Text('Two'), ], )
The crossAxisAlignment property controls horizontal alignment in a Column. Use CrossAxisAlignment.start to align children to the start horizontally.
Fill both blanks to create a Row that centers children vertically and spaces them evenly horizontally.
Row( mainAxisAlignment: [1], crossAxisAlignment: [2], children: [ Icon(Icons.home), Icon(Icons.settings), ], )
MainAxisAlignment.spaceEvenly spaces children evenly horizontally in a Row. CrossAxisAlignment.center centers children vertically.
Fill all three blanks to create a Column with children aligned to the end horizontally, spaced at the start vertically, and with minimal main axis size.
Column( crossAxisAlignment: [1], mainAxisAlignment: [2], mainAxisSize: [3], children: [ Text('A'), Text('B'), ], )
CrossAxisAlignment.end aligns children to the right horizontally in a Column. MainAxisAlignment.start aligns children to the top vertically. MainAxisSize.min makes the Column take minimal vertical space.