select_country_controller.dart 786 B

1234567891011121314151617181920212223242526272829
  1. import 'package:domain/constants/api_constants.dart';
  2. import 'package:get/get.dart';
  3. import 'package:plugin_basic/constants/app_constant.dart';
  4. import 'package:plugin_basic/service/app_config_service.dart';
  5. import 'package:plugin_basic/service/http_provider_injection.dart';
  6. import 'package:plugin_platform/engine/sp/sp_util.dart';
  7. class SelectCountryController extends GetxController {
  8. //设置下一步
  9. void setupNext() {
  10. int country = ConfigService.to.curSelectCountry.value;
  11. SPUtil.putInt(AppConstant.storageSelectedCountry, country);
  12. String baseUrl;
  13. if (country == 1){
  14. //新加坡
  15. baseUrl = ApiConstants.sgBaseUrl;
  16. }else {
  17. baseUrl = ApiConstants.baseUrl;
  18. }
  19. HttpProviderInjection.switchBaseUrl(baseUrl);
  20. Get.back();
  21. }
  22. }