In the recent flutter release, there was new feature Open Container, here is the snippet, how to set size of the openContainer, closedbuilder is accepting and rending within its bounds, but the open builder is taking full screen size.
OpenContainer(
openElevation: 0,
closedElevation: 0,
closedColor: Colors.transparent,
transitionType: ContainerTransitionType.fadeThrough,
openBuilder: (BuildContext context, VoidCallback _) {
return SizedBox( height:240,
width:MediaQuery.of(context).size.width
child:SearchWidget());
},
closedBuilder:
(BuildContext context, VoidCallback openContainer) {
return Container(
height: 50
width: 50
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
const Icon(Icons.search),
const Text('Search', style: TextStyle(fontSize: 12))
],
),