-
-
Notifications
You must be signed in to change notification settings - Fork 90
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
how to set Orientations for a certain page? #277
Comments
hello @zhaoyul , can you be more specific in your question? |
Thanks for the timely reply^_^ @dupuchba I want the following page to be in landscape mode. and when it goes back, flip back to original (portrait) mode. (def static-route
(m/Scaffold
.appBar (m/AppBar .title (m/Text "static monitor"))
.body
(f/widget
:get [m/Navigator]
:watch [ _ (s/SystemChrome.setPreferredOrientations [s/DeviceOrientation.landscapeLeft]) ;; <=== I don't think it's a good idea
]
m/Center
(m/ElevatedButton .onPressed #(.pop navigator))
(m/Text "Go back!")))) SystemChrome.setPreferredOrientations returns a promise, is there a way to write something like void main() {
SystemChrome.setPreferredOrientations(
[DeviceOrientation.portraitUp, DeviceOrientation.portraitDown]
).then((_) {
runApp(MyApp());
});
} Should I use |
https://api.flutter.dev/flutter/services/SystemChrome/setPreferredOrientations.html |
No description provided.
The text was updated successfully, but these errors were encountered: