Skip to content
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

SystemChrome does not work when usign plugin #1

Closed
marianoarga opened this issue Oct 10, 2019 · 5 comments
Closed

SystemChrome does not work when usign plugin #1

marianoarga opened this issue Oct 10, 2019 · 5 comments
Labels
question Further information is requested

Comments

@marianoarga
Copy link

SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]).then((_) {
    runApp(MyApp());
});

Wont work if using this plugin, and using this code wont too:

OrientationPlugin.forceOrientation(DeviceOrientation.portraitUp).then((_){
    runApp(MyApp());
});

The app always rotates no matter what.

@sososdk
Copy link
Owner

sososdk commented Oct 11, 2019

forceOrientation just lets the screen go to the specified direction, without limiting the screen rotation.

I think you need OrientationPlugin.setPreferredOrientations([DeviceOrientation.portraitUp]).

@sososdk sososdk added the question Further information is requested label Oct 11, 2019
@marianoarga
Copy link
Author

@sososdk I have used that before testing with forceOrientation, same result.

@sososdk
Copy link
Owner

sososdk commented Oct 11, 2019

@marianoarga Do you want to lock the screen orientation? And what is you platform?

@marianoarga
Copy link
Author

@sososdk Yes, the goal is to have the orientation locked, but listen for orientation phisical change.
I have already locked the orientation with SystemChrome.setPreferredOrientations in previous app versions, but when I add the plugin that stops working.
Android is the platform.

Btw, I have achieve my goal migrating to native_device_orientation plugin, just for you to know and maybe check it out.

Thank you.

@sososdk
Copy link
Owner

sososdk commented Oct 11, 2019

@marianoarga If you are interested you can check out example, I think it can achieve your purpose.

Thank you.

@sososdk sososdk closed this as completed Oct 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants