device_orientation

Creator: coderz1093

Last updated:

0 purchases

device_orientation Image
device_orientation Images

Languages

Categories

Add to Cart

Description:

device orientation

Device orientation #
Absolute device orientation readings based on accelerometer events.
Use to rotate certain widgets when user rotates the device
without handling complex responsiveness.

Usage #

Note: On devices that does not have or support sensors
orientation will default to DeviceOrientation.portraitUp.

Listen to a device orientation stream:
deviceOrientation$.listen((orientation) {
print(orientation);
});
copied to clipboard
Do some work based on current device orientation:
if (deviceOrientation == DeviceOrientation.portraitUp) {
// ...
}
copied to clipboard
Use helper widget to make sure that user always sees
critical widgets in correct orientation:
AnimatedAlwaysDown(
child: Text("I'm readable!")
)
copied to clipboard
If you does not need animation use:
AlwaysDown(
child: Text("I'm readable!")
)
copied to clipboard

License

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Customer Reviews

There are no reviews.