Flutter Orientation

[Solved] Flutter Orientation | Dart - Code Explorer | yomemimo.com
Question : flutter display widget based on device orientation

Answered by : mangaliso-earnshaw

build(BuildContext context) { final isLandscape = MediaQuery.of(context).orientation == Orientation.landscape; // check if the orientation is landscape // further down your code you can use 'if' or 'ternary' or both if (!isLandscape) txListWidget, if (isLandscape) _ternaryCondition ? _showFirstWidget : _showSecondWidget // the above widgets would be in a 'Row' or 'Column' }

Source : | Last Update : Wed, 25 Nov 20

Answers related to flutter orientation

Code Explorer Popular Question For Dart