device_orientation
1.0.0, released 3 years ago by wrbl.xyz
Check absolute device orientation via accelerometer and keep widgets pointing down.
$ flutter pub add device_orientationWhat it does
It reads absolute device orientation using accelerometer events, even when system rotation is disabled. It provides streams, current values, and helper widgets like AlwaysDown and AnimatedAlwaysDown to ensure critical widgets stay readable and point downwards.
AI-written summary of version 1.0.0, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need to rotate specific widgets based on physical device rotation independently of system settings.
- You want to ensure certain UI elements always point down for readability.
Skip it when
- You only need standard system-level screen rotation handled by the operating system.
- Target devices lack accelerometer sensors.
Strengths
- Works even when system rotation is disabled.
- Includes built-in helper widgets for animated and static orientation correction.
- Provides both a current value field and an orientation change stream.
Weaknesses
- Defaults to portraitUp on devices without or lacking support for accelerometer sensors.
- Limited documentation on advanced configuration.
Setup
- Kind
- Flutter widgets
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 1
not documented
AnimatedAlwaysDown(
child: Text("I'm readable!")
)Alternatives
Packages that do the same job and could replace device_orientation.
- google_api_availability
Check the availability of Google Play services on an Android device.
88Compare - device_preview_plus
Simulates how a Flutter app looks and behaves on various devices and configurations.
83Compare - is_ios_simulator
Checks whether the app is running in the iOS Simulator or on a physical device
72Compare - esim_compatibility
Check if the current Android or iOS device supports eSIM compatibility.
64Compare
Works with
Packages commonly used together with device_orientation: ones it builds on, ones built on it, and its own family.