mirror of
https://github.com/foss42/apidash.git
synced 2025-12-03 03:17:00 +08:00
Rebuild models
This commit is contained in:
@@ -13,10 +13,7 @@ part 'http_request_model.g.dart';
|
|||||||
class HttpRequestModel with _$HttpRequestModel {
|
class HttpRequestModel with _$HttpRequestModel {
|
||||||
const HttpRequestModel._();
|
const HttpRequestModel._();
|
||||||
|
|
||||||
@JsonSerializable(
|
@JsonSerializable(explicitToJson: true, anyMap: true)
|
||||||
explicitToJson: true,
|
|
||||||
anyMap: true,
|
|
||||||
)
|
|
||||||
const factory HttpRequestModel({
|
const factory HttpRequestModel({
|
||||||
@Default(HTTPVerb.get) HTTPVerb method,
|
@Default(HTTPVerb.get) HTTPVerb method,
|
||||||
@Default("") String url,
|
@Default("") String url,
|
||||||
|
|||||||
@@ -12,7 +12,8 @@ part of 'http_request_model.dart';
|
|||||||
T _$identity<T>(T value) => value;
|
T _$identity<T>(T value) => value;
|
||||||
|
|
||||||
final _privateConstructorUsedError = UnsupportedError(
|
final _privateConstructorUsedError = UnsupportedError(
|
||||||
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models');
|
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models',
|
||||||
|
);
|
||||||
|
|
||||||
HttpRequestModel _$HttpRequestModelFromJson(Map<String, dynamic> json) {
|
HttpRequestModel _$HttpRequestModelFromJson(Map<String, dynamic> json) {
|
||||||
return _HttpRequestModel.fromJson(json);
|
return _HttpRequestModel.fromJson(json);
|
||||||
@@ -44,11 +45,12 @@ mixin _$HttpRequestModel {
|
|||||||
/// @nodoc
|
/// @nodoc
|
||||||
abstract class $HttpRequestModelCopyWith<$Res> {
|
abstract class $HttpRequestModelCopyWith<$Res> {
|
||||||
factory $HttpRequestModelCopyWith(
|
factory $HttpRequestModelCopyWith(
|
||||||
HttpRequestModel value, $Res Function(HttpRequestModel) then) =
|
HttpRequestModel value,
|
||||||
_$HttpRequestModelCopyWithImpl<$Res, HttpRequestModel>;
|
$Res Function(HttpRequestModel) then,
|
||||||
|
) = _$HttpRequestModelCopyWithImpl<$Res, HttpRequestModel>;
|
||||||
@useResult
|
@useResult
|
||||||
$Res call(
|
$Res call({
|
||||||
{HTTPVerb method,
|
HTTPVerb method,
|
||||||
String url,
|
String url,
|
||||||
List<NameValueModel>? headers,
|
List<NameValueModel>? headers,
|
||||||
List<NameValueModel>? params,
|
List<NameValueModel>? params,
|
||||||
@@ -57,7 +59,8 @@ abstract class $HttpRequestModelCopyWith<$Res> {
|
|||||||
ContentType bodyContentType,
|
ContentType bodyContentType,
|
||||||
String? body,
|
String? body,
|
||||||
String? query,
|
String? query,
|
||||||
List<FormDataModel>? formData});
|
List<FormDataModel>? formData,
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/// @nodoc
|
/// @nodoc
|
||||||
@@ -86,7 +89,8 @@ class _$HttpRequestModelCopyWithImpl<$Res, $Val extends HttpRequestModel>
|
|||||||
Object? query = freezed,
|
Object? query = freezed,
|
||||||
Object? formData = freezed,
|
Object? formData = freezed,
|
||||||
}) {
|
}) {
|
||||||
return _then(_value.copyWith(
|
return _then(
|
||||||
|
_value.copyWith(
|
||||||
method: null == method
|
method: null == method
|
||||||
? _value.method
|
? _value.method
|
||||||
: method // ignore: cast_nullable_to_non_nullable
|
: method // ignore: cast_nullable_to_non_nullable
|
||||||
@@ -127,20 +131,23 @@ class _$HttpRequestModelCopyWithImpl<$Res, $Val extends HttpRequestModel>
|
|||||||
? _value.formData
|
? _value.formData
|
||||||
: formData // ignore: cast_nullable_to_non_nullable
|
: formData // ignore: cast_nullable_to_non_nullable
|
||||||
as List<FormDataModel>?,
|
as List<FormDataModel>?,
|
||||||
) as $Val);
|
)
|
||||||
|
as $Val,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// @nodoc
|
/// @nodoc
|
||||||
abstract class _$$HttpRequestModelImplCopyWith<$Res>
|
abstract class _$$HttpRequestModelImplCopyWith<$Res>
|
||||||
implements $HttpRequestModelCopyWith<$Res> {
|
implements $HttpRequestModelCopyWith<$Res> {
|
||||||
factory _$$HttpRequestModelImplCopyWith(_$HttpRequestModelImpl value,
|
factory _$$HttpRequestModelImplCopyWith(
|
||||||
$Res Function(_$HttpRequestModelImpl) then) =
|
_$HttpRequestModelImpl value,
|
||||||
__$$HttpRequestModelImplCopyWithImpl<$Res>;
|
$Res Function(_$HttpRequestModelImpl) then,
|
||||||
|
) = __$$HttpRequestModelImplCopyWithImpl<$Res>;
|
||||||
@override
|
@override
|
||||||
@useResult
|
@useResult
|
||||||
$Res call(
|
$Res call({
|
||||||
{HTTPVerb method,
|
HTTPVerb method,
|
||||||
String url,
|
String url,
|
||||||
List<NameValueModel>? headers,
|
List<NameValueModel>? headers,
|
||||||
List<NameValueModel>? params,
|
List<NameValueModel>? params,
|
||||||
@@ -149,16 +156,18 @@ abstract class _$$HttpRequestModelImplCopyWith<$Res>
|
|||||||
ContentType bodyContentType,
|
ContentType bodyContentType,
|
||||||
String? body,
|
String? body,
|
||||||
String? query,
|
String? query,
|
||||||
List<FormDataModel>? formData});
|
List<FormDataModel>? formData,
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/// @nodoc
|
/// @nodoc
|
||||||
class __$$HttpRequestModelImplCopyWithImpl<$Res>
|
class __$$HttpRequestModelImplCopyWithImpl<$Res>
|
||||||
extends _$HttpRequestModelCopyWithImpl<$Res, _$HttpRequestModelImpl>
|
extends _$HttpRequestModelCopyWithImpl<$Res, _$HttpRequestModelImpl>
|
||||||
implements _$$HttpRequestModelImplCopyWith<$Res> {
|
implements _$$HttpRequestModelImplCopyWith<$Res> {
|
||||||
__$$HttpRequestModelImplCopyWithImpl(_$HttpRequestModelImpl _value,
|
__$$HttpRequestModelImplCopyWithImpl(
|
||||||
$Res Function(_$HttpRequestModelImpl) _then)
|
_$HttpRequestModelImpl _value,
|
||||||
: super(_value, _then);
|
$Res Function(_$HttpRequestModelImpl) _then,
|
||||||
|
) : super(_value, _then);
|
||||||
|
|
||||||
/// Create a copy of HttpRequestModel
|
/// Create a copy of HttpRequestModel
|
||||||
/// with the given fields replaced by the non-null parameter values.
|
/// with the given fields replaced by the non-null parameter values.
|
||||||
@@ -176,7 +185,8 @@ class __$$HttpRequestModelImplCopyWithImpl<$Res>
|
|||||||
Object? query = freezed,
|
Object? query = freezed,
|
||||||
Object? formData = freezed,
|
Object? formData = freezed,
|
||||||
}) {
|
}) {
|
||||||
return _then(_$HttpRequestModelImpl(
|
return _then(
|
||||||
|
_$HttpRequestModelImpl(
|
||||||
method: null == method
|
method: null == method
|
||||||
? _value.method
|
? _value.method
|
||||||
: method // ignore: cast_nullable_to_non_nullable
|
: method // ignore: cast_nullable_to_non_nullable
|
||||||
@@ -217,7 +227,8 @@ class __$$HttpRequestModelImplCopyWithImpl<$Res>
|
|||||||
? _value._formData
|
? _value._formData
|
||||||
: formData // ignore: cast_nullable_to_non_nullable
|
: formData // ignore: cast_nullable_to_non_nullable
|
||||||
as List<FormDataModel>?,
|
as List<FormDataModel>?,
|
||||||
));
|
),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -225,8 +236,8 @@ class __$$HttpRequestModelImplCopyWithImpl<$Res>
|
|||||||
|
|
||||||
@JsonSerializable(explicitToJson: true, anyMap: true)
|
@JsonSerializable(explicitToJson: true, anyMap: true)
|
||||||
class _$HttpRequestModelImpl extends _HttpRequestModel {
|
class _$HttpRequestModelImpl extends _HttpRequestModel {
|
||||||
const _$HttpRequestModelImpl(
|
const _$HttpRequestModelImpl({
|
||||||
{this.method = HTTPVerb.get,
|
this.method = HTTPVerb.get,
|
||||||
this.url = "",
|
this.url = "",
|
||||||
final List<NameValueModel>? headers,
|
final List<NameValueModel>? headers,
|
||||||
final List<NameValueModel>? params,
|
final List<NameValueModel>? params,
|
||||||
@@ -235,8 +246,8 @@ class _$HttpRequestModelImpl extends _HttpRequestModel {
|
|||||||
this.bodyContentType = ContentType.json,
|
this.bodyContentType = ContentType.json,
|
||||||
this.body,
|
this.body,
|
||||||
this.query,
|
this.query,
|
||||||
final List<FormDataModel>? formData})
|
final List<FormDataModel>? formData,
|
||||||
: _headers = headers,
|
}) : _headers = headers,
|
||||||
_params = params,
|
_params = params,
|
||||||
_isHeaderEnabledList = isHeaderEnabledList,
|
_isHeaderEnabledList = isHeaderEnabledList,
|
||||||
_isParamEnabledList = isParamEnabledList,
|
_isParamEnabledList = isParamEnabledList,
|
||||||
@@ -325,10 +336,14 @@ class _$HttpRequestModelImpl extends _HttpRequestModel {
|
|||||||
(identical(other.url, url) || other.url == url) &&
|
(identical(other.url, url) || other.url == url) &&
|
||||||
const DeepCollectionEquality().equals(other._headers, _headers) &&
|
const DeepCollectionEquality().equals(other._headers, _headers) &&
|
||||||
const DeepCollectionEquality().equals(other._params, _params) &&
|
const DeepCollectionEquality().equals(other._params, _params) &&
|
||||||
const DeepCollectionEquality()
|
const DeepCollectionEquality().equals(
|
||||||
.equals(other._isHeaderEnabledList, _isHeaderEnabledList) &&
|
other._isHeaderEnabledList,
|
||||||
const DeepCollectionEquality()
|
_isHeaderEnabledList,
|
||||||
.equals(other._isParamEnabledList, _isParamEnabledList) &&
|
) &&
|
||||||
|
const DeepCollectionEquality().equals(
|
||||||
|
other._isParamEnabledList,
|
||||||
|
_isParamEnabledList,
|
||||||
|
) &&
|
||||||
(identical(other.bodyContentType, bodyContentType) ||
|
(identical(other.bodyContentType, bodyContentType) ||
|
||||||
other.bodyContentType == bodyContentType) &&
|
other.bodyContentType == bodyContentType) &&
|
||||||
(identical(other.body, body) || other.body == body) &&
|
(identical(other.body, body) || other.body == body) &&
|
||||||
@@ -349,7 +364,8 @@ class _$HttpRequestModelImpl extends _HttpRequestModel {
|
|||||||
bodyContentType,
|
bodyContentType,
|
||||||
body,
|
body,
|
||||||
query,
|
query,
|
||||||
const DeepCollectionEquality().hash(_formData));
|
const DeepCollectionEquality().hash(_formData),
|
||||||
|
);
|
||||||
|
|
||||||
/// Create a copy of HttpRequestModel
|
/// Create a copy of HttpRequestModel
|
||||||
/// with the given fields replaced by the non-null parameter values.
|
/// with the given fields replaced by the non-null parameter values.
|
||||||
@@ -358,19 +374,19 @@ class _$HttpRequestModelImpl extends _HttpRequestModel {
|
|||||||
@pragma('vm:prefer-inline')
|
@pragma('vm:prefer-inline')
|
||||||
_$$HttpRequestModelImplCopyWith<_$HttpRequestModelImpl> get copyWith =>
|
_$$HttpRequestModelImplCopyWith<_$HttpRequestModelImpl> get copyWith =>
|
||||||
__$$HttpRequestModelImplCopyWithImpl<_$HttpRequestModelImpl>(
|
__$$HttpRequestModelImplCopyWithImpl<_$HttpRequestModelImpl>(
|
||||||
this, _$identity);
|
this,
|
||||||
|
_$identity,
|
||||||
|
);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Map<String, dynamic> toJson() {
|
Map<String, dynamic> toJson() {
|
||||||
return _$$HttpRequestModelImplToJson(
|
return _$$HttpRequestModelImplToJson(this);
|
||||||
this,
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
abstract class _HttpRequestModel extends HttpRequestModel {
|
abstract class _HttpRequestModel extends HttpRequestModel {
|
||||||
const factory _HttpRequestModel(
|
const factory _HttpRequestModel({
|
||||||
{final HTTPVerb method,
|
final HTTPVerb method,
|
||||||
final String url,
|
final String url,
|
||||||
final List<NameValueModel>? headers,
|
final List<NameValueModel>? headers,
|
||||||
final List<NameValueModel>? params,
|
final List<NameValueModel>? params,
|
||||||
@@ -379,7 +395,8 @@ abstract class _HttpRequestModel extends HttpRequestModel {
|
|||||||
final ContentType bodyContentType,
|
final ContentType bodyContentType,
|
||||||
final String? body,
|
final String? body,
|
||||||
final String? query,
|
final String? query,
|
||||||
final List<FormDataModel>? formData}) = _$HttpRequestModelImpl;
|
final List<FormDataModel>? formData,
|
||||||
|
}) = _$HttpRequestModelImpl;
|
||||||
const _HttpRequestModel._() : super._();
|
const _HttpRequestModel._() : super._();
|
||||||
|
|
||||||
factory _HttpRequestModel.fromJson(Map<String, dynamic> json) =
|
factory _HttpRequestModel.fromJson(Map<String, dynamic> json) =
|
||||||
|
|||||||
@@ -6,18 +6,17 @@ part of 'http_request_model.dart';
|
|||||||
// JsonSerializableGenerator
|
// JsonSerializableGenerator
|
||||||
// **************************************************************************
|
// **************************************************************************
|
||||||
|
|
||||||
_$HttpRequestModelImpl _$$HttpRequestModelImplFromJson(Map json) =>
|
_$HttpRequestModelImpl _$$HttpRequestModelImplFromJson(
|
||||||
_$HttpRequestModelImpl(
|
Map json,
|
||||||
method: $enumDecodeNullable(_$HTTPVerbEnumMap, json['method']) ??
|
) => _$HttpRequestModelImpl(
|
||||||
HTTPVerb.get,
|
method:
|
||||||
|
$enumDecodeNullable(_$HTTPVerbEnumMap, json['method']) ?? HTTPVerb.get,
|
||||||
url: json['url'] as String? ?? "",
|
url: json['url'] as String? ?? "",
|
||||||
headers: (json['headers'] as List<dynamic>?)
|
headers: (json['headers'] as List<dynamic>?)
|
||||||
?.map((e) =>
|
?.map((e) => NameValueModel.fromJson(Map<String, Object?>.from(e as Map)))
|
||||||
NameValueModel.fromJson(Map<String, Object?>.from(e as Map)))
|
|
||||||
.toList(),
|
.toList(),
|
||||||
params: (json['params'] as List<dynamic>?)
|
params: (json['params'] as List<dynamic>?)
|
||||||
?.map((e) =>
|
?.map((e) => NameValueModel.fromJson(Map<String, Object?>.from(e as Map)))
|
||||||
NameValueModel.fromJson(Map<String, Object?>.from(e as Map)))
|
|
||||||
.toList(),
|
.toList(),
|
||||||
isHeaderEnabledList: (json['isHeaderEnabledList'] as List<dynamic>?)
|
isHeaderEnabledList: (json['isHeaderEnabledList'] as List<dynamic>?)
|
||||||
?.map((e) => e as bool)
|
?.map((e) => e as bool)
|
||||||
@@ -31,14 +30,13 @@ _$HttpRequestModelImpl _$$HttpRequestModelImplFromJson(Map json) =>
|
|||||||
body: json['body'] as String?,
|
body: json['body'] as String?,
|
||||||
query: json['query'] as String?,
|
query: json['query'] as String?,
|
||||||
formData: (json['formData'] as List<dynamic>?)
|
formData: (json['formData'] as List<dynamic>?)
|
||||||
?.map((e) =>
|
?.map((e) => FormDataModel.fromJson(Map<String, Object?>.from(e as Map)))
|
||||||
FormDataModel.fromJson(Map<String, Object?>.from(e as Map)))
|
|
||||||
.toList(),
|
.toList(),
|
||||||
);
|
);
|
||||||
|
|
||||||
Map<String, dynamic> _$$HttpRequestModelImplToJson(
|
Map<String, dynamic> _$$HttpRequestModelImplToJson(
|
||||||
_$HttpRequestModelImpl instance) =>
|
_$HttpRequestModelImpl instance,
|
||||||
<String, dynamic>{
|
) => <String, dynamic>{
|
||||||
'method': _$HTTPVerbEnumMap[instance.method]!,
|
'method': _$HTTPVerbEnumMap[instance.method]!,
|
||||||
'url': instance.url,
|
'url': instance.url,
|
||||||
'headers': instance.headers?.map((e) => e.toJson()).toList(),
|
'headers': instance.headers?.map((e) => e.toJson()).toList(),
|
||||||
@@ -49,7 +47,7 @@ Map<String, dynamic> _$$HttpRequestModelImplToJson(
|
|||||||
'body': instance.body,
|
'body': instance.body,
|
||||||
'query': instance.query,
|
'query': instance.query,
|
||||||
'formData': instance.formData?.map((e) => e.toJson()).toList(),
|
'formData': instance.formData?.map((e) => e.toJson()).toList(),
|
||||||
};
|
};
|
||||||
|
|
||||||
const _$HTTPVerbEnumMap = {
|
const _$HTTPVerbEnumMap = {
|
||||||
HTTPVerb.get: 'get',
|
HTTPVerb.get: 'get',
|
||||||
|
|||||||
@@ -44,10 +44,7 @@ class DurationConverter implements JsonConverter<Duration?, int?> {
|
|||||||
class HttpResponseModel with _$HttpResponseModel {
|
class HttpResponseModel with _$HttpResponseModel {
|
||||||
const HttpResponseModel._();
|
const HttpResponseModel._();
|
||||||
|
|
||||||
@JsonSerializable(
|
@JsonSerializable(explicitToJson: true, anyMap: true)
|
||||||
explicitToJson: true,
|
|
||||||
anyMap: true,
|
|
||||||
)
|
|
||||||
const factory HttpResponseModel({
|
const factory HttpResponseModel({
|
||||||
int? statusCode,
|
int? statusCode,
|
||||||
Map<String, String>? headers,
|
Map<String, String>? headers,
|
||||||
@@ -65,9 +62,9 @@ class HttpResponseModel with _$HttpResponseModel {
|
|||||||
MediaType? get mediaType => getMediaTypeFromHeaders(headers);
|
MediaType? get mediaType => getMediaTypeFromHeaders(headers);
|
||||||
|
|
||||||
HttpResponseModel fromResponse({required Response response, Duration? time}) {
|
HttpResponseModel fromResponse({required Response response, Duration? time}) {
|
||||||
final responseHeaders = mergeMaps(
|
final responseHeaders = mergeMaps({
|
||||||
{HttpHeaders.contentLengthHeader: response.contentLength.toString()},
|
HttpHeaders.contentLengthHeader: response.contentLength.toString(),
|
||||||
response.headers);
|
}, response.headers);
|
||||||
MediaType? mediaType = getMediaTypeFromHeaders(responseHeaders);
|
MediaType? mediaType = getMediaTypeFromHeaders(responseHeaders);
|
||||||
final body = (mediaType?.subtype == kSubTypeJson)
|
final body = (mediaType?.subtype == kSubTypeJson)
|
||||||
? utf8.decode(response.bodyBytes)
|
? utf8.decode(response.bodyBytes)
|
||||||
|
|||||||
@@ -12,7 +12,8 @@ part of 'http_response_model.dart';
|
|||||||
T _$identity<T>(T value) => value;
|
T _$identity<T>(T value) => value;
|
||||||
|
|
||||||
final _privateConstructorUsedError = UnsupportedError(
|
final _privateConstructorUsedError = UnsupportedError(
|
||||||
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models');
|
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models',
|
||||||
|
);
|
||||||
|
|
||||||
HttpResponseModel _$HttpResponseModelFromJson(Map<String, dynamic> json) {
|
HttpResponseModel _$HttpResponseModelFromJson(Map<String, dynamic> json) {
|
||||||
return _HttpResponseModel.fromJson(json);
|
return _HttpResponseModel.fromJson(json);
|
||||||
@@ -43,17 +44,19 @@ mixin _$HttpResponseModel {
|
|||||||
/// @nodoc
|
/// @nodoc
|
||||||
abstract class $HttpResponseModelCopyWith<$Res> {
|
abstract class $HttpResponseModelCopyWith<$Res> {
|
||||||
factory $HttpResponseModelCopyWith(
|
factory $HttpResponseModelCopyWith(
|
||||||
HttpResponseModel value, $Res Function(HttpResponseModel) then) =
|
HttpResponseModel value,
|
||||||
_$HttpResponseModelCopyWithImpl<$Res, HttpResponseModel>;
|
$Res Function(HttpResponseModel) then,
|
||||||
|
) = _$HttpResponseModelCopyWithImpl<$Res, HttpResponseModel>;
|
||||||
@useResult
|
@useResult
|
||||||
$Res call(
|
$Res call({
|
||||||
{int? statusCode,
|
int? statusCode,
|
||||||
Map<String, String>? headers,
|
Map<String, String>? headers,
|
||||||
Map<String, String>? requestHeaders,
|
Map<String, String>? requestHeaders,
|
||||||
String? body,
|
String? body,
|
||||||
String? formattedBody,
|
String? formattedBody,
|
||||||
@Uint8ListConverter() Uint8List? bodyBytes,
|
@Uint8ListConverter() Uint8List? bodyBytes,
|
||||||
@DurationConverter() Duration? time});
|
@DurationConverter() Duration? time,
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/// @nodoc
|
/// @nodoc
|
||||||
@@ -79,7 +82,8 @@ class _$HttpResponseModelCopyWithImpl<$Res, $Val extends HttpResponseModel>
|
|||||||
Object? bodyBytes = freezed,
|
Object? bodyBytes = freezed,
|
||||||
Object? time = freezed,
|
Object? time = freezed,
|
||||||
}) {
|
}) {
|
||||||
return _then(_value.copyWith(
|
return _then(
|
||||||
|
_value.copyWith(
|
||||||
statusCode: freezed == statusCode
|
statusCode: freezed == statusCode
|
||||||
? _value.statusCode
|
? _value.statusCode
|
||||||
: statusCode // ignore: cast_nullable_to_non_nullable
|
: statusCode // ignore: cast_nullable_to_non_nullable
|
||||||
@@ -108,35 +112,40 @@ class _$HttpResponseModelCopyWithImpl<$Res, $Val extends HttpResponseModel>
|
|||||||
? _value.time
|
? _value.time
|
||||||
: time // ignore: cast_nullable_to_non_nullable
|
: time // ignore: cast_nullable_to_non_nullable
|
||||||
as Duration?,
|
as Duration?,
|
||||||
) as $Val);
|
)
|
||||||
|
as $Val,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// @nodoc
|
/// @nodoc
|
||||||
abstract class _$$HttpResponseModelImplCopyWith<$Res>
|
abstract class _$$HttpResponseModelImplCopyWith<$Res>
|
||||||
implements $HttpResponseModelCopyWith<$Res> {
|
implements $HttpResponseModelCopyWith<$Res> {
|
||||||
factory _$$HttpResponseModelImplCopyWith(_$HttpResponseModelImpl value,
|
factory _$$HttpResponseModelImplCopyWith(
|
||||||
$Res Function(_$HttpResponseModelImpl) then) =
|
_$HttpResponseModelImpl value,
|
||||||
__$$HttpResponseModelImplCopyWithImpl<$Res>;
|
$Res Function(_$HttpResponseModelImpl) then,
|
||||||
|
) = __$$HttpResponseModelImplCopyWithImpl<$Res>;
|
||||||
@override
|
@override
|
||||||
@useResult
|
@useResult
|
||||||
$Res call(
|
$Res call({
|
||||||
{int? statusCode,
|
int? statusCode,
|
||||||
Map<String, String>? headers,
|
Map<String, String>? headers,
|
||||||
Map<String, String>? requestHeaders,
|
Map<String, String>? requestHeaders,
|
||||||
String? body,
|
String? body,
|
||||||
String? formattedBody,
|
String? formattedBody,
|
||||||
@Uint8ListConverter() Uint8List? bodyBytes,
|
@Uint8ListConverter() Uint8List? bodyBytes,
|
||||||
@DurationConverter() Duration? time});
|
@DurationConverter() Duration? time,
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/// @nodoc
|
/// @nodoc
|
||||||
class __$$HttpResponseModelImplCopyWithImpl<$Res>
|
class __$$HttpResponseModelImplCopyWithImpl<$Res>
|
||||||
extends _$HttpResponseModelCopyWithImpl<$Res, _$HttpResponseModelImpl>
|
extends _$HttpResponseModelCopyWithImpl<$Res, _$HttpResponseModelImpl>
|
||||||
implements _$$HttpResponseModelImplCopyWith<$Res> {
|
implements _$$HttpResponseModelImplCopyWith<$Res> {
|
||||||
__$$HttpResponseModelImplCopyWithImpl(_$HttpResponseModelImpl _value,
|
__$$HttpResponseModelImplCopyWithImpl(
|
||||||
$Res Function(_$HttpResponseModelImpl) _then)
|
_$HttpResponseModelImpl _value,
|
||||||
: super(_value, _then);
|
$Res Function(_$HttpResponseModelImpl) _then,
|
||||||
|
) : super(_value, _then);
|
||||||
|
|
||||||
/// Create a copy of HttpResponseModel
|
/// Create a copy of HttpResponseModel
|
||||||
/// with the given fields replaced by the non-null parameter values.
|
/// with the given fields replaced by the non-null parameter values.
|
||||||
@@ -151,7 +160,8 @@ class __$$HttpResponseModelImplCopyWithImpl<$Res>
|
|||||||
Object? bodyBytes = freezed,
|
Object? bodyBytes = freezed,
|
||||||
Object? time = freezed,
|
Object? time = freezed,
|
||||||
}) {
|
}) {
|
||||||
return _then(_$HttpResponseModelImpl(
|
return _then(
|
||||||
|
_$HttpResponseModelImpl(
|
||||||
statusCode: freezed == statusCode
|
statusCode: freezed == statusCode
|
||||||
? _value.statusCode
|
? _value.statusCode
|
||||||
: statusCode // ignore: cast_nullable_to_non_nullable
|
: statusCode // ignore: cast_nullable_to_non_nullable
|
||||||
@@ -180,7 +190,8 @@ class __$$HttpResponseModelImplCopyWithImpl<$Res>
|
|||||||
? _value.time
|
? _value.time
|
||||||
: time // ignore: cast_nullable_to_non_nullable
|
: time // ignore: cast_nullable_to_non_nullable
|
||||||
as Duration?,
|
as Duration?,
|
||||||
));
|
),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -188,15 +199,15 @@ class __$$HttpResponseModelImplCopyWithImpl<$Res>
|
|||||||
|
|
||||||
@JsonSerializable(explicitToJson: true, anyMap: true)
|
@JsonSerializable(explicitToJson: true, anyMap: true)
|
||||||
class _$HttpResponseModelImpl extends _HttpResponseModel {
|
class _$HttpResponseModelImpl extends _HttpResponseModel {
|
||||||
const _$HttpResponseModelImpl(
|
const _$HttpResponseModelImpl({
|
||||||
{this.statusCode,
|
this.statusCode,
|
||||||
final Map<String, String>? headers,
|
final Map<String, String>? headers,
|
||||||
final Map<String, String>? requestHeaders,
|
final Map<String, String>? requestHeaders,
|
||||||
this.body,
|
this.body,
|
||||||
this.formattedBody,
|
this.formattedBody,
|
||||||
@Uint8ListConverter() this.bodyBytes,
|
@Uint8ListConverter() this.bodyBytes,
|
||||||
@DurationConverter() this.time})
|
@DurationConverter() this.time,
|
||||||
: _headers = headers,
|
}) : _headers = headers,
|
||||||
_requestHeaders = requestHeaders,
|
_requestHeaders = requestHeaders,
|
||||||
super._();
|
super._();
|
||||||
|
|
||||||
@@ -249,8 +260,10 @@ class _$HttpResponseModelImpl extends _HttpResponseModel {
|
|||||||
(identical(other.statusCode, statusCode) ||
|
(identical(other.statusCode, statusCode) ||
|
||||||
other.statusCode == statusCode) &&
|
other.statusCode == statusCode) &&
|
||||||
const DeepCollectionEquality().equals(other._headers, _headers) &&
|
const DeepCollectionEquality().equals(other._headers, _headers) &&
|
||||||
const DeepCollectionEquality()
|
const DeepCollectionEquality().equals(
|
||||||
.equals(other._requestHeaders, _requestHeaders) &&
|
other._requestHeaders,
|
||||||
|
_requestHeaders,
|
||||||
|
) &&
|
||||||
(identical(other.body, body) || other.body == body) &&
|
(identical(other.body, body) || other.body == body) &&
|
||||||
(identical(other.formattedBody, formattedBody) ||
|
(identical(other.formattedBody, formattedBody) ||
|
||||||
other.formattedBody == formattedBody) &&
|
other.formattedBody == formattedBody) &&
|
||||||
@@ -268,7 +281,8 @@ class _$HttpResponseModelImpl extends _HttpResponseModel {
|
|||||||
body,
|
body,
|
||||||
formattedBody,
|
formattedBody,
|
||||||
const DeepCollectionEquality().hash(bodyBytes),
|
const DeepCollectionEquality().hash(bodyBytes),
|
||||||
time);
|
time,
|
||||||
|
);
|
||||||
|
|
||||||
/// Create a copy of HttpResponseModel
|
/// Create a copy of HttpResponseModel
|
||||||
/// with the given fields replaced by the non-null parameter values.
|
/// with the given fields replaced by the non-null parameter values.
|
||||||
@@ -277,25 +291,26 @@ class _$HttpResponseModelImpl extends _HttpResponseModel {
|
|||||||
@pragma('vm:prefer-inline')
|
@pragma('vm:prefer-inline')
|
||||||
_$$HttpResponseModelImplCopyWith<_$HttpResponseModelImpl> get copyWith =>
|
_$$HttpResponseModelImplCopyWith<_$HttpResponseModelImpl> get copyWith =>
|
||||||
__$$HttpResponseModelImplCopyWithImpl<_$HttpResponseModelImpl>(
|
__$$HttpResponseModelImplCopyWithImpl<_$HttpResponseModelImpl>(
|
||||||
this, _$identity);
|
this,
|
||||||
|
_$identity,
|
||||||
|
);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Map<String, dynamic> toJson() {
|
Map<String, dynamic> toJson() {
|
||||||
return _$$HttpResponseModelImplToJson(
|
return _$$HttpResponseModelImplToJson(this);
|
||||||
this,
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
abstract class _HttpResponseModel extends HttpResponseModel {
|
abstract class _HttpResponseModel extends HttpResponseModel {
|
||||||
const factory _HttpResponseModel(
|
const factory _HttpResponseModel({
|
||||||
{final int? statusCode,
|
final int? statusCode,
|
||||||
final Map<String, String>? headers,
|
final Map<String, String>? headers,
|
||||||
final Map<String, String>? requestHeaders,
|
final Map<String, String>? requestHeaders,
|
||||||
final String? body,
|
final String? body,
|
||||||
final String? formattedBody,
|
final String? formattedBody,
|
||||||
@Uint8ListConverter() final Uint8List? bodyBytes,
|
@Uint8ListConverter() final Uint8List? bodyBytes,
|
||||||
@DurationConverter() final Duration? time}) = _$HttpResponseModelImpl;
|
@DurationConverter() final Duration? time,
|
||||||
|
}) = _$HttpResponseModelImpl;
|
||||||
const _HttpResponseModel._() : super._();
|
const _HttpResponseModel._() : super._();
|
||||||
|
|
||||||
factory _HttpResponseModel.fromJson(Map<String, dynamic> json) =
|
factory _HttpResponseModel.fromJson(Map<String, dynamic> json) =
|
||||||
|
|||||||
@@ -17,14 +17,15 @@ _$HttpResponseModelImpl _$$HttpResponseModelImplFromJson(Map json) =>
|
|||||||
),
|
),
|
||||||
body: json['body'] as String?,
|
body: json['body'] as String?,
|
||||||
formattedBody: json['formattedBody'] as String?,
|
formattedBody: json['formattedBody'] as String?,
|
||||||
bodyBytes:
|
bodyBytes: const Uint8ListConverter().fromJson(
|
||||||
const Uint8ListConverter().fromJson(json['bodyBytes'] as List<int>?),
|
json['bodyBytes'] as List<int>?,
|
||||||
|
),
|
||||||
time: const DurationConverter().fromJson((json['time'] as num?)?.toInt()),
|
time: const DurationConverter().fromJson((json['time'] as num?)?.toInt()),
|
||||||
);
|
);
|
||||||
|
|
||||||
Map<String, dynamic> _$$HttpResponseModelImplToJson(
|
Map<String, dynamic> _$$HttpResponseModelImplToJson(
|
||||||
_$HttpResponseModelImpl instance) =>
|
_$HttpResponseModelImpl instance,
|
||||||
<String, dynamic>{
|
) => <String, dynamic>{
|
||||||
'statusCode': instance.statusCode,
|
'statusCode': instance.statusCode,
|
||||||
'headers': instance.headers,
|
'headers': instance.headers,
|
||||||
'requestHeaders': instance.requestHeaders,
|
'requestHeaders': instance.requestHeaders,
|
||||||
@@ -32,4 +33,4 @@ Map<String, dynamic> _$$HttpResponseModelImplToJson(
|
|||||||
'formattedBody': instance.formattedBody,
|
'formattedBody': instance.formattedBody,
|
||||||
'bodyBytes': const Uint8ListConverter().toJson(instance.bodyBytes),
|
'bodyBytes': const Uint8ListConverter().toJson(instance.bodyBytes),
|
||||||
'time': const DurationConverter().toJson(instance.time),
|
'time': const DurationConverter().toJson(instance.time),
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ dependencies:
|
|||||||
http: ^1.3.0
|
http: ^1.3.0
|
||||||
http_parser: ^4.1.2
|
http_parser: ^4.1.2
|
||||||
json5: ^0.8.2
|
json5: ^0.8.2
|
||||||
|
json_annotation: ^4.9.0
|
||||||
seed: ^0.0.3
|
seed: ^0.0.3
|
||||||
xml: ^6.3.0
|
xml: ^6.3.0
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user