checkScreenOrientation method
Checks the current screen orientation.
This function checks the current screen orientation of the device and returns
the corresponding orientation type as an enum value of ScreenOrientationTypes.
It returns null
if the orientation can't be determined.
Returns:
- A Future<ScreenOrientationTypes?> that completes with the current screen orientation,
or
null
if the orientation is undetermined.
Example Usage:
ScreenOrientationTypes? orientation = await checkScreenOrientation();
if (orientation != null) {
// Handle the orientation logic here
} else {
// Handle case when orientation can't be determined
}
This method should be implemented to provide the actual screen orientation check logic.
Implementation
@override
Future<ScreenOrientationTypes?> checkScreenOrientation() async {
return await ThanPkg.android.app.checkOrientation();
}