You can get the size of the screen in flutter using MediaQuery as below.
var screenOrientation = MediaQuery.of(context).orientation;
Here is an example of how to use that in your program.
import 'package:flutter/material.dart';
void main(List<String> args) { runApp(const MyApp());}
class MyApp extends StatelessWidget { const MyApp({super.key});
@override Widget build(BuildContext context) { return const MaterialApp( home: Scaffold( body: MyContainer(), ), ); }}
class MyContainer extends StatelessWidget { const MyContainer({ super.key, });
@override Widget build(BuildContext context) { var screenOrientation = MediaQuery.of(context).orientation;
return Center( child: Padding( padding: const EdgeInsets.symmetric(vertical: 100), child: Padding( padding: const EdgeInsets.all(28.0), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ const SizedBox( height: 20, ), Text( 'Screen Orientation - $screenOrientation', style: const TextStyle(fontSize: 18.0), ), ], ), ), ), ); }}