flutter dio 或 http 在某些模拟器上不起作用

flutter dio or http doesn't work on some emulators

我在不同的 PC 上克隆了我的代码。它对其中一些有效,对其他无效。 我有一个带有手机号码的登录屏幕。当我发送请求时,没有任何反应,也没有给出任何响应。但完全相同的代码在其他电脑上工作正常并发送验证码。我不知道有什么区别导致它无法在我的电脑上运行。

Future<Response> init(String mobile) async {
  Response response;
  try {
    response = await Dio()
        .post(URLs.BASE_URL + URLs.INIT, data: InitModel(mobile: mobile));
  } on DioError catch (e) {}
  return response;
}

这里我称之为:

 void onPressed() {
    var text = tEC?.text?.trim();
    init("0$text").then((response) {
      setState(() {
        Navigator.of(context).pushReplacement(
          MaterialPageRoute(
            builder: (context) => ConfirmCode(
              mobileNum: tEC.text,
              message: response.data['message'],
            ),
          ),
        );
      });
    });
  }

这是因为模拟器的代理设置。我将其从“android 工作室代理设置”更改为“无代理”。