setOrientationState method

  1. @override
Future<void> setOrientationState(
  1. bool enabled
)
override

Future method to set the device orientation lock status.

Implementation

@override
Future<void> setOrientationState(bool enabled) async {
  try {
    await methodChannel
        .invokeMethod('setOrientationState', {'enabled': enabled});
  } on PlatformException catch (e) {
    log('Error setting orientation lock: ${e.message}');
  }
}