setForcedOrientation method

  1. @override
Future<bool?> setForcedOrientation(
  1. SeeSoOrientation orientation
)
override

Implementation

@override
Future<bool?> setForcedOrientation(SeeSoOrientation orientation) async {
  int orienationValue = 0;
  switch (orientation) {
    case SeeSoOrientation.PORTRAIT:
      orienationValue = 1;
    case SeeSoOrientation.PORTRAIT_UPSIDE_DOWN:
      orienationValue = 2;
    case SeeSoOrientation.LANDSCAPE_RIGHT:
      orienationValue = 3;
    case SeeSoOrientation.LANDSCAPE_LEFT:
      orienationValue = 4;
  }
  Map<String, dynamic> arguments = {
    SeeSoPluginArgumentKey.ORIENTATION.name: orienationValue
  };
  return await methodChannel.invokeMethod<bool>(
      SeeSoPluginMethod.SET_FORCED_ORIENTATION.name, arguments);
}