Answers for "flutter lock screen rotation"

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
1

flutter lock orientation

@override
void initState(){
  super.initState();
  SystemChrome.setPreferredOrientations([
      DeviceOrientation.landscapeRight,
      DeviceOrientation.landscapeLeft,
  ]);
}
Posted by: Guest on August-07-2020
0

how to disable screen rotation in flutter

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

Code answers related to "flutter lock screen rotation"

Browse Popular Code Answers by Language