zl程序教程

您现在的位置是:首页 >  移动开发

当前栏目

flutter的dio网络请求,成功与失败的操作

flutter网络 操作 请求 成功 失败
2023-09-14 09:04:29 时间
 Response result = await Dio().post(apiUrl, data: map, options: options);
    if (result.statusCode == 200) {
      //如果接口请求成功就跳转到首页
      Navigator.push(
        context,
        MaterialPageRoute(builder: (context) => const MusicPlayer()),
      );
    } else {
      print("登录失败");
    }