setEnvironment static method

dynamic setEnvironment({
  1. FastAppEnvironment environment = FastAppEnvironment.product,
  2. bool showLog = false,
  3. String proxy = '',
  4. bool grpc = false,
  5. bool restful = true,
  6. String devAddress = '',
  7. String testAddress = '',
  8. String productAddress = '',
  9. String guestAddress = '',
  10. String version = '',
})

Implementation

static setEnvironment({
  FastAppEnvironment environment = FastAppEnvironment.product,
  bool showLog = false,
  String proxy = '',
  bool grpc = false,
  bool restful = true,
  String devAddress = '',
  String testAddress = '',
  String productAddress = '',
  String guestAddress = '',
  String version = '',
}) async {
  WidgetsFlutterBinding.ensureInitialized();

  fastVersion = version;
  currentEnvironment = environment;

  environmentConfig = new EnvironmentConfig(
    environment: environment,
    showLog: showLog,
    proxy: proxy,
    grpc: grpc,
    restful: restful,
  );

  fastApiHostConfig = new FastApiHostConfig(
    devAddress: devAddress,
    testAddress: testAddress,
    productAddress: productAddress,
    geustAddress: guestAddress,
  );

  String? e = await getStoreValue("GeustEnvironment");

  if(FastData.isLogin && e == '1'){
     FastApp.setGeustEnvironment();
  }
}