Disable Screen Rotation Orientation
Complete Code For Disable Screen Rotation Orientation In Flutter
Main.dart
import 'package:flutter/material.dart';
import 'package:flutter/services.dart' ;
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
SystemChrome.setPreferredOrientations([
DeviceOrientation.portraitUp,
]);
return MaterialApp(
debugShowCheckedModeBanner: false,
home: Scaffold(
backgroundColor: Colors.black,
appBar: AppBar(
title: Text("Disable Screen Rotation in Flutter App"),
),
body: SafeArea(
child : Center(
child:Text('Disable Screen Rotation in Flutter App',
style: TextStyle(fontSize: 20,color: Colors.white),)
)
)
),
);
}
}