Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View guid-empty's full-sized avatar

guid-empty guid-empty

View GitHub Profile
@guid-empty
guid-empty / logging_interceptor.dart
Created February 2, 2022 23:17 — forked from apgapg/logging_interceptor.dart
Logging interceptor for dio, flutter
import 'dart:async';
import 'package:dio/dio.dart';
import 'package:flutter/cupertino.dart';
/// [LoggingInterceptor] is used to print logs during network requests.
/// It's better to add [LoggingInterceptor] to the tail of the interceptor queue,
/// otherwise the changes made in the interceptor behind A will not be printed out.
/// This is because the execution of interceptors is in the order of addition.
class LoggingInterceptor extends Interceptor {