Answers for "disable screen rotation flutter"

2

how to stop screen rotation in flutter

class MyApp extends StatelessWidget {
    @override
    Widget build(BuildContext context) {
      SystemChrome.setPreferredOrientations([
        DeviceOrientation.portraitUp,
        DeviceOrientation.portraitDown,
      ]);
      return new MaterialApp(...);
    }
  }
Posted by: Guest on August-09-2020
0

how to disable screen rotation in flutter

void main() {
  // add these lines
  WidgetsFlutterBinding.ensureInitialized();
  SystemChrome.setPreferredOrientations(
      [DeviceOrientation.portraitUp, DeviceOrientation.portraitDown]);

  ///////////// 
  runApp(MyApp());
}
Posted by: Guest on September-08-2021
0

how to disable screen rotation in flutter

import 'package:flutter/services.dart';
Posted by: Guest on September-08-2021

Code answers related to "disable screen rotation flutter"

Code answers related to "Dart"

Browse Popular Code Answers by Language