constants.dart 1.6 KB

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