constants.dart 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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.68:56389";
  8. static const String _testBaseUrl = "http://loc-api.v8dashen.com";
  9. static const String _prodBaseUrl = "http://loc-api.v8dashen.com";
  10. static const String locationClientUrl =
  11. "ws://loc-api.v8dashen.com/websocket/";
  12. static String baseUrl = getBaseUrl();
  13. static bool isProdEnv() {
  14. return Constants.env == Constants.envProd;
  15. }
  16. static const String appDefaultChannel = "Android";
  17. static const int appDefaultAppId = 0;
  18. static const int appDefaultTgPlatformId = 0;
  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 mineLocationId = '';
  23. static const String traceStartId = '-100';
  24. static const String traceEndId = '-200';
  25. static const double blurredX = 4.2;
  26. static const double blurredY = 4.2;
  27. }
  28. String getBaseUrl() {
  29. switch (Constants.env) {
  30. case Constants.envDev:
  31. return Constants._devBaseUrl;
  32. case Constants.envTest:
  33. return Constants._testBaseUrl;
  34. case Constants.envProd:
  35. return Constants._prodBaseUrl;
  36. default:
  37. return Constants._devBaseUrl;
  38. }
  39. }