switchLayoutOrientation method

Future<void> switchLayoutOrientation()

Implementation

Future<void> switchLayoutOrientation() async {
  if (_rootContext == null) {
    TCICLog.error("rootContext is null", actionModule: ActionModule.tcicController.name, actionName: ActionName.switchLayoutOrientation.name);
    return;
  }
  final isPortrait = MediaQuery.of(_rootContext!).orientation == Orientation.portrait;
  if (isPortrait) {
    await setLayoutOrientation(LayoutOrientation.landscape);
  } else {
    await setLayoutOrientation(LayoutOrientation.portrait);
  }
}