mirror of
https://github.com/foss42/apidash.git
synced 2025-11-30 17:59:18 +08:00
refactor: formatting action revert
This commit is contained in:
@@ -44,7 +44,10 @@ class DurationConverter implements JsonConverter<Duration?, int?> {
|
||||
class HttpResponseModel with _$HttpResponseModel {
|
||||
const HttpResponseModel._();
|
||||
|
||||
@JsonSerializable(explicitToJson: true, anyMap: true)
|
||||
@JsonSerializable(
|
||||
explicitToJson: true,
|
||||
anyMap: true,
|
||||
)
|
||||
const factory HttpResponseModel({
|
||||
int? statusCode,
|
||||
Map<String, String>? headers,
|
||||
@@ -62,9 +65,9 @@ class HttpResponseModel with _$HttpResponseModel {
|
||||
MediaType? get mediaType => getMediaTypeFromHeaders(headers);
|
||||
|
||||
HttpResponseModel fromResponse({required Response response, Duration? time}) {
|
||||
final responseHeaders = mergeMaps({
|
||||
HttpHeaders.contentLengthHeader: response.contentLength.toString(),
|
||||
}, response.headers);
|
||||
final responseHeaders = mergeMaps(
|
||||
{HttpHeaders.contentLengthHeader: response.contentLength.toString()},
|
||||
response.headers);
|
||||
MediaType? mediaType = getMediaTypeFromHeaders(responseHeaders);
|
||||
final body = (mediaType?.subtype == kSubTypeJson)
|
||||
? utf8.decode(response.bodyBytes)
|
||||
|
||||
Reference in New Issue
Block a user