native_device_orientation
2.1.3, released 2 months ago by an unverified publisher
A Flutter plugin for reading native device orientation from UI or sensors.
What it does
Allows Flutter applications to read the native device orientation on Android and iOS. It differentiates between landscape left and landscape right, and can optionally read orientation directly from device sensors.
AI-written summary of version 2.1.3, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need to differentiate between landscape left and landscape right.
- You need to read orientation directly from device sensors instead of just window size.
- You want built-in widgets to handle orientation layouts automatically.
Skip it when
- Standard Flutter orientation checks based on screen dimensions are sufficient for your app.
Strengths
- Differentiates landscape left from landscape right.
- Supports both UI orientation and direct sensor readings.
- Provides convenient built-in reader and oriented widgets.
Weaknesses
- Sensor-based orientation has been tested less thoroughly.
- Requires platform-specific configuration adjustments for Swift Package Manager on iOS.
Setup
- Kind
- Plugin (native code)
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 1
May require cleaning build files or adjusting iOS folder settings when using Swift Package Manager.
NativeDeviceOrientationReader(
builder: (context) {
Orientation orientation = NativeDeviceOrientationReader.orientation(context);
return Text("Current orientation: $orientation");
},
)Alternatives
Packages that do the same job and could replace native_device_orientation.
- device_calendar_plus
Plugin for reading and writing device calendar events on Android and iOS.
83Compare - carp_mobile_sensing
Mobile sensing framework for collecting sensor and device data via configurable probes.
77Compare - dchs_motion_sensors
Flutter plugin for accessing Android and iOS accelerometer, gyroscope, magnetometer, and orientation.
75Compare - auto_orientation_v2
Programmatically control device orientation on iOS, Android, and Web.
72Compare
Works with
Packages commonly used together with native_device_orientation: ones it builds on, ones built on it, and its own family.
- plugin_platform_interfacenative_device_orientation depends on itReusable base class for platform interfaces of Flutter federated plugins.
- flutter_rotation_sensorBuilt on native_device_orientationProvides a stream of device orientation data including rotation matrix, quaternion, and Euler angles.
- apivideo_live_streamBuilt on native_device_orientationFlutter RTMP live stream client to broadcast video and audio from smartphone camera.
- zego_uikitBuilt on native_device_orientationPre-built voice and video calling UI components and low-code integration.
- qr_mobile_visionBuilt on native_device_orientationPlugin for reading QR codes and barcodes using Mobile Vision APIs.