Answers for "how to adjust portrait and landscape in flutter"

0

flutter portrait only

// This will works always for lock screen Orientation.
void main() {
  WidgetsFlutterBinding.ensureInitialized();
  SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp])
    .then((_) {
      runApp(new MyApp());
    });
}
Posted by: Guest on August-14-2020
0

set orientation to landscape flutter

SystemChrome.setPreferredOrientations([DeviceOrientation.landscapeLeft,DeviceOrientation.landscapeRight])
Posted by: Guest on June-15-2021

Code answers related to "how to adjust portrait and landscape in flutter"

Browse Popular Code Answers by Language