Answers for "flutter hide widget in landscape orientation"

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

flutter only portrait

void main() {
  WidgetsFlutterBinding.ensureInitialized();
  SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp])
    .then((_) {
      runApp(new MyApp());
    });
}
Posted by: Guest on May-01-2021
0

set orientation to landscape flutter

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

Code answers related to "flutter hide widget in landscape orientation"

Browse Popular Code Answers by Language