omega_dio_logger 1.0.1 omega_dio_logger: ^1.0.1 copied to clipboard
Dio interceptor that logs network calls in a pretty, easy to read format with curl command
// ignore_for_file: avoid_redundant_argument_values
import 'dart:developer' show log;
import 'package:dio/dio.dart';
import 'package:flutter/foundation.dart' show kDebugMode;
import 'package:omega_dio_logger/omega_dio_logger.dart';
void main() {
final dio = Dio();
dio.interceptors.add(
const OmegaDioLogger(
logPrint: log,
convertFormData: true,
showError: true,
showRequest: true,
showRequestBody: true,
showRequestHeaders: true,
showRequestQueryParameters: true,
showResponse: true,
showResponseBody: true,
showResponseHeaders: true,
showCurl: true,
showLog: kDebugMode,
),
);
}