相关疑难解决方法(0)

为什么在安装app-release.apk时flutter应用程序无法连接到Internet?但在调试模式下正常

在调试模式下,一切看起来都不错,可以从我的API获取响应和数据列表。但是在我构建app-release.apk并安装到手机后,它显示没有互联网连接

这是我的代码

ScopedModelDescendant<ReportPosViewModel>(
  builder: (context, child, model) {
    return FutureBuilder<List<Invoice>>(
      future: model.invoices,
      builder: (_,
          AsyncSnapshot<List<Invoice>> snapshot) {
        switch (snapshot.connectionState) {
          case ConnectionState.none:
          case ConnectionState.active:
          case ConnectionState.waiting:
            return Center(
                child:
                    const CircularProgressIndicator());
          case ConnectionState.done:
            if (snapshot.hasData) {
              //something todo
            } else if (snapshot.hasError) {
              return NoInternetConnection(
                action: () async {
                  await model.setInvoice();
                  await getData();
                },
              );
            }
        }
      },
    );
  },
),
Run Code Online (Sandbox Code Playgroud)

api debugging release flutter

8
推荐指数
4
解决办法
3740
查看次数

标签 统计

api ×1

debugging ×1

flutter ×1

release ×1