Testing Rails Sample
Testing Rails Sample
Testing Rails Sample
Cheat Sheet
codingwithflutter.com
Version 1.0
© 2018 Andrea Bizzotto
Introduction
Further Reading
• Building Layouts in Flutter
• Layout Widgets
MainAxisAlignment.end MainAxisAlignment.spaceAround
MainAxisAlignment.center MainAxisAlignment.spaceEvenly
MainAxisSize.min
Note: setting MainAxisSize.min minimises the amount of free space along
the main axis.
Row.crossAxisAlignment
Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
crossAxisAlignment: _crossAxisAlignment,
children: [
Icon(Icons.stars, size: 50.0),
Icon(Icons.stars, size: 100.0),
Icon(Icons.stars, size: 50.0),
],
)
CrossAxisAlignment.center
CrossAxisAlignment.end
CrossAxisAlignment.stretch
(fills all the space in the cross axis)
Column(
mainAxisAlignment: _mainAxisAlignment,
mainAxisSize: MainAxisSize.max,
children: [
Icon(Icons.stars, size: 50.0),
Icon(Icons.stars, size: 50.0),
Icon(Icons.stars, size: 50.0),
],
)
CrossAxisAlignment.stretch
Stack.alignment
Stack(
alignment: _alignmentDirectional,
children:[
SizedBox(
width: 300.0,
height: 300.0,
child: Container(color: Colors.green),
),
SizedBox(
width: 200.0,
height: 200.0,
child: Container(color: Colors.yellow),
),
SizedBox(
width: 100.0,
height: 100.0,
child: Container(color: Colors.red),
),
],
)
Row(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
Expanded(
flex: 1,
child: Container(
color: Colors.yellow,
child: Center(child: Text('flex: 1')),
),
),
Expanded(
flex: 2,
child: Container(
color: Colors.orange,
child: Center(child: Text('flex: 2')),
),
),
Expanded(
flex: 3,
child: Container(
color: Colors.cyan,
child: Center(child: Text('flex: 3')),
),
),
],
)
Container(
color: Colors.yellow,
padding: EdgeInsets.all(16.0),
child: Row(
children: [
Expanded(
flex: 1,
child: Container(
color: Colors.green,
child: Center(child: Text('flex: 1')),
),
),
SizedBox(width: 40.0),
Expanded(
flex: 2,
child: Container(
color: Colors.cyan,
child: Center(child: Text('flex: 2')),
),
),
],
),
)