import '../../utils/mmkv_util.dart';

class Constants {
  Constants._();

  static const String env = envProd;

  static const String envDev = 'dev';

  static const String envTest = 'test';

  static const String envProd = 'prod';

  static const String _devBaseUrl = "http://192.168.10.113:8880";

  static const String _testBaseUrl = "http://42.193.245.11";

  static const String _prodBaseUrl = "https://project-api.atmob.com";




  static String baseUrl = getBaseUrl();

  static bool isProdEnv() {
    return Constants.env == Constants.envProd;
  }



  // TTARCLW,BDARCLWXM测试用特定渠道 Android
  static const String appDefaultChannel = "TTARCLW";
  static const int appDefaultAppId = 0;
  static const int appDefaultTgPlatformId = 0;
  static const String appChanelName = "app_channel_name";
  static const String appChannelId = "app_channel_id";
  static const String appTgPlatformId = "app_tg_platform_id";

  /// 上传九宫格，最大格子数量
  static const int uploadNineGridMaxCount = 9;

  /// 上传九宫格，一列多少个
  static const int uploadNineGridCrossAxisCount = 3;

  static const String keyIsLogin = 'keyIsLogin';
  static const String keyIsMember = 'keyIsMember';
  //系统键盘选中的键盘
  static const String keyboardSelect ="keyboard_select";

  // 首次进入应用
  static const String isFirstIntro = 'isFirstIntro';

  // 是否首次显示键盘引导
  static const String isFirstShowKeyboardGuide = 'isFirstShowKeyboardGuide';

  // 是否首先显示键盘教程
  static const String isFirstShowKeyboardTutorial = 'isFirstShowKeyboardTutorial';

  // 是否首次进入活动页
  static const String isFirstIntoDiscount = 'isFirstIntoDiscount';


}

String getBaseUrl() {
  switch (Constants.env) {
    case Constants.envDev:
      return Constants._devBaseUrl;
    case Constants.envTest:
      return Constants._testBaseUrl;
    case Constants.envProd:
      return Constants._prodBaseUrl;
    default:
      return Constants._devBaseUrl;
  }
}

bool isFirstIntro() {
  return KVUtil.getBool(Constants.isFirstIntro, true);
}

void setFirstIntro(bool isFirst) {
  KVUtil.putBool(Constants.isFirstIntro, isFirst);
}



bool isFirstIntoDiscount() {
  return KVUtil.getBool(Constants.isFirstIntoDiscount, true);
}

void setFirstIntoDiscount(bool isFirst) {
  KVUtil.putBool(Constants.isFirstIntoDiscount, isFirst);
}





