Answers for "how to change the orientation of one page in flutter"

1

flutter lock screen to portrait mode

void main() {
// flutter lock screen to portrait mode
  WidgetsFlutterBinding.ensureInitialized();
  SystemChrome.setPreferredOrientations([
    DeviceOrientation.portraitUp,
    DeviceOrientation.portraitDown,
  ]);
  runApp(MyBudgetApp());
}
Posted by: Guest on November-18-2020
1

flutter lock orientation

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

Code answers related to "how to change the orientation of one page in flutter"

Browse Popular Code Answers by Language