PrintingClientDelegate class

This class is used for printing request and responses Example:

ApiClient apiClient = ApiClient(
  basePath: 'Config.url',
  apiClientDelegate: PrintingClientDelegate(
    onResponse: (String requestLog) => print(requestLog),
    logLevels: {
      'a/call/you/dont/want/to/log/like/file/upload': LogLevel.none,
      'a/frequent/call': LogLevel.url,
    },
  ),
);
Inheritance
  • Object
  • DioClientDelegate
  • PrintingClientDelegate

Constructors

PrintingClientDelegate({Dio? client, required dynamic onResponse(String), Map<String, LogLevel> logLevels = const {}, LogLevel defaultLogLevel = LogLevel.body})

Properties

client → Dio
finalinherited
defaultLogLevel LogLevel
final
hashCode int
The hash code for this object.
no setterinherited
logLevels Map<String, LogLevel>
final
onResponse → dynamic Function(String)
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

invokeAPI(String basePath, String path, Iterable<QueryParam> queryParams, Object? body, Options options, {bool passErrorsAsApiResponses = false}) Future<ApiResponse>
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited