constants.dart 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. import 'package:flutter_screenutil/flutter_screenutil.dart';
  2. import '../../utils/mmkv_util.dart';
  3. class Constants {
  4. Constants._();
  5. static const String env = envProd;
  6. static const String envDev = 'dev';
  7. static const String envTest = 'test';
  8. static const String envProd = 'prod';
  9. static const String _devBaseUrl = "http://192.168.10.230:8880";
  10. static const String _testBaseUrl = "http://42.193.245.11";
  11. static const String _prodBaseUrl = "https://project-api.atmob.com";
  12. static const String privacyPolicy =
  13. "https://doc.v8dashen.com/doc/298eb75d38dc2c4a";
  14. static const String userAgreement =
  15. "https://doc.v8dashen.com/doc/417838a4f155ec74";
  16. static const String personalInformationList =
  17. "https://doc.v8dashen.com/doc/d82db8fc7ac57d7f";
  18. static const String thirdPartyList =
  19. "https://doc.v8dashen.com/doc/626cfc364a1358a9";
  20. static const String kidPolicy =
  21. "https://doc.v8dashen.com/doc/0bc7b973c78011c9";
  22. static String baseUrl = getBaseUrl();
  23. static bool isProdEnv() {
  24. return Constants.env == Constants.envProd;
  25. }
  26. // TTARCLW,BDARCLWXM测试用特定渠道 Android
  27. static const String appDefaultChannel = "TTARCLW";
  28. static const int appDefaultAppId = 0;
  29. static const int appDefaultTgPlatformId = 0;
  30. static const String appChanelName = "app_channel_name";
  31. static const String appChannelId = "app_channel_id";
  32. static const String appTgPlatformId = "app_tg_platform_id";
  33. }
  34. String getBaseUrl() {
  35. switch (Constants.env) {
  36. case Constants.envDev:
  37. return Constants._devBaseUrl;
  38. case Constants.envTest:
  39. return Constants._testBaseUrl;
  40. case Constants.envProd:
  41. return Constants._prodBaseUrl;
  42. default:
  43. return Constants._devBaseUrl;
  44. }
  45. }