Answers for "flutter display widget based on device orientation"

1

flutter display widget based on device orientation

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'
        }
Posted by: Guest on November-18-2020

Code answers related to "flutter display widget based on device orientation"

Code answers related to "Dart"

Browse Popular Code Answers by Language