Complete the code to align children widgets horizontally in the center using MainAxisAlignment.
Row(
mainAxisAlignment: MainAxisAlignment.[1],
children: [
Icon(Icons.star),
Icon(Icons.star),
],
)Using MainAxisAlignment.center centers the children horizontally in a Row.
Complete the code to align children widgets vertically at the start using CrossAxisAlignment.
Column( crossAxisAlignment: CrossAxisAlignment.[1], children: [ Text('Hello'), Text('World'), ], )
CrossAxisAlignment.start aligns children to the top in a Column.
Fix the error in the code by choosing the correct MainAxisAlignment value to space children evenly.
Row(
mainAxisAlignment: MainAxisAlignment.[1],
children: [
Icon(Icons.home),
Icon(Icons.search),
Icon(Icons.settings),
],
)MainAxisAlignment.spaceBetween places equal space between children but no space at ends.
Fill both blanks to align children in a Column stretched horizontally and centered vertically.
Column( crossAxisAlignment: CrossAxisAlignment.[1], mainAxisAlignment: MainAxisAlignment.[2], children: [ Container(height: 50, color: Colors.red), Container(height: 50, color: Colors.blue), ], )
crossAxisAlignment.stretch makes children fill horizontally.mainAxisAlignment.center centers children vertically.
Fill all three blanks to create a Row with children spaced evenly, aligned at the end vertically, and stretched horizontally.
Row( mainAxisAlignment: MainAxisAlignment.[1], crossAxisAlignment: CrossAxisAlignment.[2], children: [ Container(width: 50, height: 50, color: Colors.green), Container(width: 50, height: 50, color: Colors.yellow), ], mainAxisSize: MainAxisSize.[3], )
mainAxisAlignment.spaceEvenly spaces children evenly horizontally.crossAxisAlignment.end aligns children at bottom vertically.mainAxisSize.max makes Row take max horizontal space.