constants.dart 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. import '../../utils/mmkv_util.dart';
  2. class Constants {
  3. Constants._();
  4. static const String env = envProd;
  5. static const String envDev = 'dev';
  6. static const String envTest = 'test';
  7. static const String envProd = 'prod';
  8. static const String _devBaseUrl = "http://192.168.10.68:56389";
  9. static const String _testBaseUrl = "http://loc-api.v8dashen.com";
  10. static const String _prodBaseUrl = "http://loc-api.v8dashen.com";
  11. static String baseUrl = getBaseUrl();
  12. static bool isProdEnv() {
  13. return Constants.env == Constants.envProd;
  14. }
  15. static const String appDefaultChannel = "Android";
  16. static const int appDefaultAppId = 0;
  17. static const int appDefaultTgPlatformId = 0;
  18. static const String appChanelName = "app_channel_name";
  19. static const String appChannelId = "app_channel_id";
  20. static const String appTgPlatformId = "app_tg_platform_id";
  21. static const String mineLocationId = '-1';
  22. }
  23. String getBaseUrl() {
  24. switch (Constants.env) {
  25. case Constants.envDev:
  26. return Constants._devBaseUrl;
  27. case Constants.envTest:
  28. return Constants._testBaseUrl;
  29. case Constants.envProd:
  30. return Constants._prodBaseUrl;
  31. default:
  32. return Constants._devBaseUrl;
  33. }
  34. }