Answers for "dio download on error"

0

dio download on error

Options options= new Options(
    responseType: ResponseType.STREAM
);
Dio dio = new Dio(options);
try {
  Response response = await dio.download(
      url, outputDirectory + filename, flush: true);
  dio.interceptor.response.onError = (DioError e) {
    print("error=" + e.message);
  };
} on DioError catch (e) {
  print("error "+e.message);
}
Posted by: Guest on June-13-2021

Browse Popular Code Answers by Language