I am trying to make layout of app where main container will have 45% of device height and container inside main container should be of fix size.
I have written following code but inner container takes full height as its parent(main) container.
class TestContainer extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Container(
width: 50,
height:MediaQuery.of(context).size.height * 0.45,
color: Colors.red
child:Container(
width: 50,
height: 100,
color: Colors.green
)
);
}
}
Any clue what I am doing wrong with this ?