refactor: formatting action revert

This commit is contained in:
Manas Hejmadi
2025-06-22 21:28:43 +05:30
parent f20b3d8bb6
commit 1b64d05fc5
17 changed files with 179 additions and 204 deletions

View File

@@ -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)