flutter make container have same widget as parent code example
Example 1: flutter get parent width
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: flutter column min height screen sixe
import 'dart:math';
LayoutBuilder(
builder: (BuildContext context, BoxConstraints constraints) {
return SingleChildScrollView(
child: ConstrainedBox(
constraints: BoxConstraints.tightFor(height: max(500, constraints.maxHeight)),
child: Column(),
),
);
},
);