setOrientationLandscape function
void
setOrientationLandscape()
Locks the screen orientation to landscape mode.
- Allows only landscapeRight and landscapeLeft.
- Useful for gaming apps, video players, and drawing apps.
Example Usage:
setOrientationLandscape();
Implementation
void setOrientationLandscape() {
SystemChrome.setPreferredOrientations([
DeviceOrientation.landscapeRight,
DeviceOrientation.landscapeLeft,
]);
}