Overview
The auto_orientation package enables programmatic control of device screen orientation on both Android and iOS. It allows developers to lock or unlock the screen orientation dynamically during runtime, ensuring optimal user experience across different app states. This is particularly useful in apps requiring consistent orientation for specific views, such as video players or games. The package integrates seamlessly with Flutter and supports both landscape and portrait modes. It works by leveraging native platform APIs through platform channels.
Use cases
- Video playback with fixed orientation
- Games requiring locked screen orientation
- Forms or UIs that need consistent layout
- Cross-platform orientation management
- Dynamic orientation changes based on content
Key features
- Programmatically set orientation
- Supports Android and iOS
- Locks/unlocks orientation at runtime
- Minimal boilerplate
- Uses native platform channels
Suitable for
- Apps needing dynamic orientation control
- Developers targeting both iOS and Android
- UI-heavy applications
- Media or gaming apps
- Responsive layouts requiring orientation consistency
Considerations
- Requires appropriate permissions on some devices
- May conflict with system-level orientation settings
- Not suitable for all use cases due to platform restrictions
- Limited to supported orientations
- Behavior may vary slightly between platforms