Want to get pretty network logs that look like this?
- ✅ 200 ✅
- 🟠 308 🟠
- ❌ 404 ❌
With Dio, this is super easy:
- add an interceptor and override the
onResponse
method - call a helper function that maps HTTP status codes to emojis with a switch expression
Don't want to roll this out yourself or need a more robust solution?
Then, use Talker - an advanced error handler and logger for Flutter (check this cool web demo).
A separate talker_dio_logger package also exists, which is perfect for this use case. 👌
Found this useful? Show some love and share the original tweet
Previous | Next |
---|---|
Scroll-to-index inside a ListView | Zoom an image with InteractiveViewer |