Skip to content

A flutter plugin to programmatically change the orientation and rotate

License

Notifications You must be signed in to change notification settings

Colton127/auto_orientation

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

45 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

auto_orientation

This plugin was created to programmatically rotate on iOS and Android

Getting Started

After importing the package you can use:
AutoOrientation.landscapeLeftMode(); or
AutoOrientation.landscapeRightMode(); or
AutoOrientation.portraitDownMode(); (might not work) or
AutoOrientation.portraitUpMode(); or
AutoOrientation.portraitAutoMode(); or
AutoOrientation.portraitAutoMode(forceSensor: true); (Use sensor data to change direction, ignoring user's rotation preference. Much like Youtube fullscreen. Android only) or
AutoOrientation.landscapeAutoMode(); or
AutoOrientation.landscapeAutoMode(forceSensor: true); (Use sensor data to change direction, ignoring user's rotation preference. Much like Youtube fullscreen. Android only) or
AutoOrientation.fullAutoMode();

No need to call SystemChrome.setPreferredOrientations because it has been added to the library itself.
This has been done because before android auto-rotation wasn't working after setting rotation using the plugin.

We've used it for a VideoScaffold, to programmatically change to landscape and back to portrait if the scaffold is disposed.

Example

Please have a look in the example/ folder

About

A flutter plugin to programmatically change the orientation and rotate

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Dart 42.5%
  • Java 26.0%
  • Objective-C 16.6%
  • Ruby 14.2%
  • Kotlin 0.7%