Flutter landscape orientation layout. You could probably use the primary property of a Scaffold, in combination of detecting the orientation through a simple MediaQuery. So on landscape mode, set the primary flag to false to tell the Scaffold to not take status bar height into account when determining the AppBar height.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | @override Widget build(BuildContext context) { final Orientation orientation = MediaQuery.of(context).orientation; final bool isLandscape = orientation == Orientation.landscape; return new Scaffold( primary: !isLandscape, appBar: new AppBar( title: new Text('AppBar title'), ), body: new Center( child: new Text('Look at the appbar on landscape!'), ), ); } |
If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.