import 'package:clean/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 = "https://ws00.south.takin.cc";

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

  static const String _prodBaseUrl = "https://clean-os-api.supercleaner.club";

  static const String privacyPolicy =
      "https://cdn.supercleaner.club/static/cleanpro/clean_pro_privacy.html";

  static const String userAgreement =
      "https://cdn.supercleaner.club/static/cleanpro/clean_pro_terms.html";

  static const String isPolicyGranted = 'isPolicyGranted';
  static const String isIntro = 'isIntroduction';
  static const String isFirstClickHomeClean = 'isFirstClickClean';
  static String baseUrl = getBaseUrl();

  static const String appDefaultChannel = "Android";
  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 String firstOpenPhotoPreview = 'firstOpenPhotoPreview';

  static const String isFirstIntoApp = 'isFirstIntoApp';

  static const String isFirstIntoStore = 'isFirstIntoStore';

}

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;
  }
}

class PayPlatform {
  static const int android = 1;
  static const int apple = 2;
}

class PayMethod {
  static const int alipay = 1;
  static const int wechat = 2;
  static const int apple = 3;
  static const int google = 4;
  static const int douYin = 5;
}

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

void setFirstOpenPhotoPreview(bool firstTime) {
  KVUtil.putBool(Constants.firstOpenPhotoPreview, firstTime);
}

bool isFirstIntro() {
  return KVUtil.getBool(Constants.isIntro, true);
}
void setFirstIntro(bool firstTime) {
  KVUtil.putBool(Constants.isIntro, firstTime);
}

bool isAgreePrivacyPolicy() {
  return KVUtil.getBool(Constants.isPolicyGranted, false);
}
void setPrivacyPolicy(bool isAgree) {
  KVUtil.putBool(Constants.isPolicyGranted, isAgree);
}


bool isFirstClickHomeClean() {
  return KVUtil.getBool(Constants.isFirstClickHomeClean, true);
}
void setFirstClickHomeClean(bool isFirst) {
  KVUtil.putBool(Constants.isFirstClickHomeClean, isFirst);
}

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

void setFirstIntoApp(bool isFirst) {
  KVUtil.putBool(Constants.isFirstIntoApp, isFirst);
}

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

void setFirstIntoStore(bool isFirst) {
  KVUtil.putBool(Constants.isFirstIntoStore, isFirst);
}






