constants.dart 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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. static const String keyLastSelectFriendId = 'key_last_select_friend_id';
  28. }
  29. String getBaseUrl() {
  30. switch (Constants.env) {
  31. case Constants.envDev:
  32. return Constants._devBaseUrl;
  33. case Constants.envTest:
  34. return Constants._testBaseUrl;
  35. case Constants.envProd:
  36. return Constants._prodBaseUrl;
  37. default:
  38. return Constants._devBaseUrl;
  39. }
  40. }