Milad-Akarie / pretty_dio_logger

MIT License
238 stars 53 forks source link

When using dio.download for a streamed download it crashes #5

Closed d-silveira closed 4 years ago

d-silveira commented 4 years ago

I'm using an instance of dio with custom configurations for all my app requests, I have responseBody logging enabled, which works perfectly for most of my requests. Unfortunately for dio.download it crashes because body is not a String.

type 'ResponseBody' is not a subtype of type 'String'
#0      PrettyDioLogger._printResponse (package:pretty_dio_logger/pretty_dio_logger.dart:148:30)
#1      PrettyDioLogger.onResponse (package:pretty_dio_logger/pretty_dio_logger.dart:124:7)
#2      DioMixin._request._interceptorWrapper.<anonymous closure>.<anonymous closure>.<anonymous closure> (package:dio/src/dio.dart:828:37)
#3      DioMixin.checkIfNeedEnqueue (package:dio/src/dio.dart:1099:22)
#4      DioMixin._request._interceptorWrapper.<anonymous closure>.<anonymous closure> (package:dio/src/dio.dart:825:22)
#5      new Future.<anonymous closure> (dart:async/future.dart:176:37)
#6      _rootRun (dart:async/zone.dart:1122:38)
#7      _CustomZone.run (dart:async/zone.dart:1023:19)
#8      _CustomZone.runGuarded (dart:async/zone.dart:925:7)
#9      _CustomZone.bindCallbackGuarded.<anonymous closure> (dart:async/zone.dart:965:23)
#10     _rootRun (dart:async/zone.d<…>
Milad-Akarie commented 4 years ago

hey @d-silveira, I believe this's been fixed before, are you sure you're using the latest version v1.1.0?