Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/http/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Flutter 删除颤振中的.bg api http返回后映像_Flutter_Http - Fatal编程技术网

Flutter 删除颤振中的.bg api http返回后映像

Flutter 删除颤振中的.bg api http返回后映像,flutter,http,Flutter,Http,[错误:flatter/lib/ui/ui\u dart\u state.cc(177)]未处理的异常:FormatException:无效 性格 (第1部分) E/颤振(27845):‰巴布亚新几内亚 E/颤振(27845):^ plllzzzzz neeeed help这就是显示的内容[ERROR:flatter/lib/ui/ui_dart_state.cc(177)]未处理的异常:FormatException:Invalid character(在字符1处)E/flatter(278

[错误:flatter/lib/ui/ui\u dart\u state.cc(177)]未处理的异常:FormatException:无效

性格 (第1部分) E/颤振(27845):‰巴布亚新几内亚 E/颤振(27845):^


plllzzzzz neeeed help这就是显示的内容[ERROR:flatter/lib/ui/ui_dart_state.cc(177)]未处理的异常:FormatException:Invalid character(在字符1处)E/flatter(27845):PNG E/flatter(27845):^[ERROR:flatter/lib/ui/ui_dart_state.cc(177)]未处理的异常:FormatException:Invalid character(在字符1处)E/flatter(27845):PNG E/flatter(27845):^[错误:flatter/lib/ui/ui\u dart\u state.cc(177)]未处理的异常:FormatException:无效字符(位于字符1处)E/flatter(27845):PNG E/flatter(27845):^
_asyncMethod() async {
ByteData bytes = await rootBundle.load('assets/images/technology.jpg');
var buffer = bytes.buffer;
var m = base64.encode(Uint8List.view(buffer));

final body = {"image_file_b64": m, "size": "auto"};
final headers = {"X-API-Key": "xxxxxxxxxxxxxxxxxxxx"};
final response = await http.post('https://api.remove.bg/v1.0/removebg',
    body: body, headers: headers);

if (response.statusCode == 200) {
  responseBody = response.body;
  var jsonResponse = convert.jsonDecode(response.body);
  debugPrint("$jsonResponse");
  //var itemCount = jsonResponse['data'];
  // ignore: unnecessary_statements
} else {
  throw Exception(
      'Failed to do network requests: Error Code: ${response.statusCode}\nBody: ${response.body}');
}