auto_orientation_v2
2.4.7, released 6 weeks ago by rizkyghofur.my.id
Programmatically control device orientation on iOS, Android, and Web.
What it does
Allows Flutter apps to programmatically switch between portrait, landscape, and auto rotation modes on iOS, Android, and Web. It includes helper getters for checking orientation and a declarative AutoOrientationScope widget for automatic locking and reverting.
AI-written summary of version 2.4.7, based on the package's README and metadata. Report an inaccuracy
Use it when
- You are building a video player that needs to switch to landscape in fullscreen.
- You are creating a game or reading app requiring specific forced orientations.
Skip it when
- You prefer manually invoking SystemChrome.setPreferredOrientations exclusively.
Strengths
- Supports forceSensor on Android to override user rotation settings.
- Provides a declarative AutoOrientationScope widget.
- Includes orientation helper getters like isLandscape and isPortrait.
Weaknesses
- Some portrait down modes may not function properly on all devices.
Setup
- Kind
- Plugin (native code)
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 1
Add the dependency to pubspec.yaml and import the package. Do not manually call SystemChrome.setPreferredOrientations.
AutoOrientation.landscapeRightMode();Alternatives
Packages that do the same job and could replace auto_orientation_v2.
- auto_orientation
Programmatically set device orientation on iOS and Android.
50Compare - flutter_ble_peripheral
Set a device into BLE peripheral mode and advertise custom services.
86Compare - native_device_orientation
A Flutter plugin for reading native device orientation from UI or sensors.
79Compare - flutter_rotation_sensor
Provides a stream of device orientation data including rotation matrix, quaternion, and Euler angles.
79Compare
Works with
Packages commonly used together with auto_orientation_v2: ones it builds on, ones built on it, and its own family.