flutter layouts code example
Example 1: flutter layout builder
var container = new Container(
width: 100.0,
child: new LayoutBuilder(
builder: (BuildContext context, BoxConstraints constraints) {
if(constraints.maxWidth > 200.0) {
return new Text('BIG');
} else {
return new Text('SMALL');
}
}
),
);
Example 2: align column to center of flex flutter
mainAxisAlignment: MainAxisAlignment.center
crossAxisAlignment: CrossAxisAlignment.center
mainAxisAlignment: MainAxisAlignment.center
crossAxisAlignment: CrossAxisAlignment.center