Scaffold( appBar: AppBar(), body: Align( alignment: Alignment.topCenter, child: LayoutBuilder( builder: (BuildContext context, BoxConstraints constraints) { return Container( height: constraints.maxHeight / 2, width: MediaQuery.of(context).size.width / 2, color: Colors.red, ); }, ), ), );