constants.dart 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. class Constants {
  2. Constants._();
  3. static const String env = envDev;
  4. static const String envDev = 'dev';
  5. static const String envTest = 'test';
  6. static const String envProd = 'prod';
  7. static const String _devBaseUrl = "https://ws00.south.takin.cc";
  8. static const String _testBaseUrl = "http://42.193.245.11";
  9. static const String _prodBaseUrl = "https://project-api.atmob.com";
  10. static const String privacyPolicy =
  11. "https://cdn.supercleaner.club/static/cleanpro/clean_pro_privacy.html";
  12. static const String userAgreement =
  13. "https://cdn.supercleaner.club/static/cleanpro/clean_pro_terms.html";
  14. static String baseUrl = getBaseUrl();
  15. static const String appDefaultChannel = "Android";
  16. static const int appDefaultAppId = 0;
  17. static const int appDefaultTgPlatformId = 0;
  18. //渠道
  19. static const String appChanelName = "app_channel_name";
  20. static const String appChannelId = "app_channel_id";
  21. static const String appTgPlatformId = "app_tg_platform_id";
  22. static const String firstOpenPhotoPreview = 'firstOpenPhotoPreview';
  23. }
  24. String getBaseUrl() {
  25. switch (Constants.env) {
  26. case Constants.envDev:
  27. return Constants._devBaseUrl;
  28. case Constants.envTest:
  29. return Constants._testBaseUrl;
  30. case Constants.envProd:
  31. return Constants._prodBaseUrl;
  32. default:
  33. return Constants._devBaseUrl;
  34. }
  35. }
  36. class PayPlatform {
  37. static const int android = 1;
  38. static const int apple = 2;
  39. }
  40. class PayMethod {
  41. static const int alipay = 1;
  42. static const int wechat = 2;
  43. static const int apple = 3;
  44. static const int google = 4;
  45. static const int douYin = 5;
  46. }
  47. bool isFirstOpenPhotoPreview() {
  48. return KVUtil.getBool(Constants.firstOpenPhotoPreview, true);
  49. }
  50. void setFirstOpenPhotoPreview(bool firstTime) {
  51. KVUtil.putBool(Constants.firstOpenPhotoPreview, firstTime);
  52. }