import 'package:get/get.dart';
import 'package:injectable/injectable.dart';
import 'package:keyboard/utils/atmob_log.dart';

import '../../../base/base_controller.dart';
import '../../../utils/url_launcher_util.dart';
import '../video/keyboard_tutorial_video_page.dart';

/// 键盘教程页-iOS平台Controller
@injectable
class KeyboardTutorialIosViewController extends BaseController {
  final String _tag = "KeyboardTutorialIosViewController";

  /// 点击返回
  void clickBack() {
    Get.back();
  }

  /// 跳转去视频教程引导页
  void clickTutorialVideo() {
    KeyboardTutorialVideoPage.start();
  }

  /// 去开启键盘
  void goEnableKeyboard() async {
    bool result = await UrlLauncherUtil.openIosSystemKeyboardPage();
    if (result) {
      AtmobLog.d(_tag, "打开iOS系统键盘设置页 => 成功");
    } else {
      AtmobLog.d(_tag, "打开iOS系统键盘设置页 => 失败");
    }
  }
}
