Closed sebastianbuechler closed 4 months ago
I want to use the recommended debugPrint as logPrint option:
_dio.interceptors.add( PrettyDioLogger( logPrint: debugPrint ), )
However, I get an error that it is not valid because debugPrint is of the wrong type:
The argument type 'void Function(String?, {int? wrapWidth})' can't be assigned to the parameter type 'void Function(Object)'.dart(argument_type_not_assignable)
How is this intended to work?
void appDebugPrint(Object message) {
debugPrint(message.toString());
}
dio
..options.baseUrl = url
..interceptors.add(PrettyDioLogger(logPrint: appDebugPrint));
I want to use the recommended debugPrint as logPrint option:
_dio.interceptors.add( PrettyDioLogger( logPrint: debugPrint ), )
However, I get an error that it is not valid because debugPrint is of the wrong type:The argument type 'void Function(String?, {int? wrapWidth})' can't be assigned to the parameter type 'void Function(Object)'.dart(argument_type_not_assignable)
How is this intended to work?void appDebugPrint(Object message) { debugPrint(message.toString()); } dio ..options.baseUrl = url ..interceptors.add(PrettyDioLogger(logPrint: appDebugPrint));
In one line:
dio..interceptors.add(PrettyDioLogger(logPrint: (o) => debugPrint(o.toString())));
I want to use the recommended debugPrint as logPrint option:
_dio.interceptors.add( PrettyDioLogger( logPrint: debugPrint ), )
However, I get an error that it is not valid because debugPrint is of the wrong type:
The argument type 'void Function(String?, {int? wrapWidth})' can't be assigned to the parameter type 'void Function(Object)'.dart(argument_type_not_assignable)
How is this intended to work?