Created
October 4, 2022 02:39
-
-
Save Fanreza/0b2adaedab222f56a2162b06b27c4b8a to your computer and use it in GitHub Desktop.
Disable Orientation Change in Flutter
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/services.dart'; | |
void main() { | |
WidgetsFlutterBinding.ensureInitialized(); | |
SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]) | |
.then((_) { | |
runApp(const MyApp()); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment