mirror of
https://github.com/foss42/apidash.git
synced 2025-12-01 18:28:25 +08:00
refactor: move authModel to HttpRequestModel
This commit is contained in:
@@ -15,7 +15,6 @@ class RequestModel with _$RequestModel {
|
||||
@Default(APIType.rest) APIType apiType,
|
||||
@Default("") String name,
|
||||
@Default("") String description,
|
||||
@Default(AuthModel(type: APIAuthType.none)) AuthModel? authModel,
|
||||
@JsonKey(includeToJson: false) @Default(0) requestTabIndex,
|
||||
HttpRequestModel? httpRequestModel,
|
||||
int? responseStatus,
|
||||
|
||||
@@ -24,7 +24,6 @@ mixin _$RequestModel {
|
||||
APIType get apiType => throw _privateConstructorUsedError;
|
||||
String get name => throw _privateConstructorUsedError;
|
||||
String get description => throw _privateConstructorUsedError;
|
||||
AuthModel? get authModel => throw _privateConstructorUsedError;
|
||||
@JsonKey(includeToJson: false)
|
||||
dynamic get requestTabIndex => throw _privateConstructorUsedError;
|
||||
HttpRequestModel? get httpRequestModel => throw _privateConstructorUsedError;
|
||||
@@ -60,7 +59,6 @@ abstract class $RequestModelCopyWith<$Res> {
|
||||
APIType apiType,
|
||||
String name,
|
||||
String description,
|
||||
AuthModel? authModel,
|
||||
@JsonKey(includeToJson: false) dynamic requestTabIndex,
|
||||
HttpRequestModel? httpRequestModel,
|
||||
int? responseStatus,
|
||||
@@ -71,7 +69,6 @@ abstract class $RequestModelCopyWith<$Res> {
|
||||
String? preRequestScript,
|
||||
String? postRequestScript});
|
||||
|
||||
$AuthModelCopyWith<$Res>? get authModel;
|
||||
$HttpRequestModelCopyWith<$Res>? get httpRequestModel;
|
||||
$HttpResponseModelCopyWith<$Res>? get httpResponseModel;
|
||||
}
|
||||
@@ -95,7 +92,6 @@ class _$RequestModelCopyWithImpl<$Res, $Val extends RequestModel>
|
||||
Object? apiType = null,
|
||||
Object? name = null,
|
||||
Object? description = null,
|
||||
Object? authModel = freezed,
|
||||
Object? requestTabIndex = freezed,
|
||||
Object? httpRequestModel = freezed,
|
||||
Object? responseStatus = freezed,
|
||||
@@ -123,10 +119,6 @@ class _$RequestModelCopyWithImpl<$Res, $Val extends RequestModel>
|
||||
? _value.description
|
||||
: description // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
authModel: freezed == authModel
|
||||
? _value.authModel
|
||||
: authModel // ignore: cast_nullable_to_non_nullable
|
||||
as AuthModel?,
|
||||
requestTabIndex: freezed == requestTabIndex
|
||||
? _value.requestTabIndex
|
||||
: requestTabIndex // ignore: cast_nullable_to_non_nullable
|
||||
@@ -166,20 +158,6 @@ class _$RequestModelCopyWithImpl<$Res, $Val extends RequestModel>
|
||||
) as $Val);
|
||||
}
|
||||
|
||||
/// Create a copy of RequestModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
$AuthModelCopyWith<$Res>? get authModel {
|
||||
if (_value.authModel == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return $AuthModelCopyWith<$Res>(_value.authModel!, (value) {
|
||||
return _then(_value.copyWith(authModel: value) as $Val);
|
||||
});
|
||||
}
|
||||
|
||||
/// Create a copy of RequestModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@@ -222,7 +200,6 @@ abstract class _$$RequestModelImplCopyWith<$Res>
|
||||
APIType apiType,
|
||||
String name,
|
||||
String description,
|
||||
AuthModel? authModel,
|
||||
@JsonKey(includeToJson: false) dynamic requestTabIndex,
|
||||
HttpRequestModel? httpRequestModel,
|
||||
int? responseStatus,
|
||||
@@ -233,8 +210,6 @@ abstract class _$$RequestModelImplCopyWith<$Res>
|
||||
String? preRequestScript,
|
||||
String? postRequestScript});
|
||||
|
||||
@override
|
||||
$AuthModelCopyWith<$Res>? get authModel;
|
||||
@override
|
||||
$HttpRequestModelCopyWith<$Res>? get httpRequestModel;
|
||||
@override
|
||||
@@ -258,7 +233,6 @@ class __$$RequestModelImplCopyWithImpl<$Res>
|
||||
Object? apiType = null,
|
||||
Object? name = null,
|
||||
Object? description = null,
|
||||
Object? authModel = freezed,
|
||||
Object? requestTabIndex = freezed,
|
||||
Object? httpRequestModel = freezed,
|
||||
Object? responseStatus = freezed,
|
||||
@@ -286,10 +260,6 @@ class __$$RequestModelImplCopyWithImpl<$Res>
|
||||
? _value.description
|
||||
: description // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
authModel: freezed == authModel
|
||||
? _value.authModel
|
||||
: authModel // ignore: cast_nullable_to_non_nullable
|
||||
as AuthModel?,
|
||||
requestTabIndex: freezed == requestTabIndex
|
||||
? _value.requestTabIndex!
|
||||
: requestTabIndex,
|
||||
@@ -338,7 +308,6 @@ class _$RequestModelImpl implements _RequestModel {
|
||||
this.apiType = APIType.rest,
|
||||
this.name = "",
|
||||
this.description = "",
|
||||
this.authModel = const AuthModel(type: APIAuthType.none),
|
||||
@JsonKey(includeToJson: false) this.requestTabIndex = 0,
|
||||
this.httpRequestModel,
|
||||
this.responseStatus,
|
||||
@@ -364,9 +333,6 @@ class _$RequestModelImpl implements _RequestModel {
|
||||
@JsonKey()
|
||||
final String description;
|
||||
@override
|
||||
@JsonKey()
|
||||
final AuthModel? authModel;
|
||||
@override
|
||||
@JsonKey(includeToJson: false)
|
||||
final dynamic requestTabIndex;
|
||||
@override
|
||||
@@ -390,7 +356,7 @@ class _$RequestModelImpl implements _RequestModel {
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'RequestModel(id: $id, apiType: $apiType, name: $name, description: $description, authModel: $authModel, requestTabIndex: $requestTabIndex, httpRequestModel: $httpRequestModel, responseStatus: $responseStatus, message: $message, httpResponseModel: $httpResponseModel, isWorking: $isWorking, sendingTime: $sendingTime, preRequestScript: $preRequestScript, postRequestScript: $postRequestScript)';
|
||||
return 'RequestModel(id: $id, apiType: $apiType, name: $name, description: $description, requestTabIndex: $requestTabIndex, httpRequestModel: $httpRequestModel, responseStatus: $responseStatus, message: $message, httpResponseModel: $httpResponseModel, isWorking: $isWorking, sendingTime: $sendingTime, preRequestScript: $preRequestScript, postRequestScript: $postRequestScript)';
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -403,8 +369,6 @@ class _$RequestModelImpl implements _RequestModel {
|
||||
(identical(other.name, name) || other.name == name) &&
|
||||
(identical(other.description, description) ||
|
||||
other.description == description) &&
|
||||
(identical(other.authModel, authModel) ||
|
||||
other.authModel == authModel) &&
|
||||
const DeepCollectionEquality()
|
||||
.equals(other.requestTabIndex, requestTabIndex) &&
|
||||
(identical(other.httpRequestModel, httpRequestModel) ||
|
||||
@@ -432,7 +396,6 @@ class _$RequestModelImpl implements _RequestModel {
|
||||
apiType,
|
||||
name,
|
||||
description,
|
||||
authModel,
|
||||
const DeepCollectionEquality().hash(requestTabIndex),
|
||||
httpRequestModel,
|
||||
responseStatus,
|
||||
@@ -465,7 +428,6 @@ abstract class _RequestModel implements RequestModel {
|
||||
final APIType apiType,
|
||||
final String name,
|
||||
final String description,
|
||||
final AuthModel? authModel,
|
||||
@JsonKey(includeToJson: false) final dynamic requestTabIndex,
|
||||
final HttpRequestModel? httpRequestModel,
|
||||
final int? responseStatus,
|
||||
@@ -488,8 +450,6 @@ abstract class _RequestModel implements RequestModel {
|
||||
@override
|
||||
String get description;
|
||||
@override
|
||||
AuthModel? get authModel;
|
||||
@override
|
||||
@JsonKey(includeToJson: false)
|
||||
dynamic get requestTabIndex;
|
||||
@override
|
||||
|
||||
@@ -12,10 +12,6 @@ _$RequestModelImpl _$$RequestModelImplFromJson(Map json) => _$RequestModelImpl(
|
||||
APIType.rest,
|
||||
name: json['name'] as String? ?? "",
|
||||
description: json['description'] as String? ?? "",
|
||||
authModel: json['authModel'] == null
|
||||
? const AuthModel(type: APIAuthType.none)
|
||||
: AuthModel.fromJson(
|
||||
Map<String, dynamic>.from(json['authModel'] as Map)),
|
||||
requestTabIndex: json['requestTabIndex'] ?? 0,
|
||||
httpRequestModel: json['httpRequestModel'] == null
|
||||
? null
|
||||
@@ -41,7 +37,6 @@ Map<String, dynamic> _$$RequestModelImplToJson(_$RequestModelImpl instance) =>
|
||||
'apiType': _$APITypeEnumMap[instance.apiType]!,
|
||||
'name': instance.name,
|
||||
'description': instance.description,
|
||||
'authModel': instance.authModel?.toJson(),
|
||||
'httpRequestModel': instance.httpRequestModel?.toJson(),
|
||||
'responseStatus': instance.responseStatus,
|
||||
'message': instance.message,
|
||||
|
||||
@@ -207,7 +207,7 @@ class CollectionStateNotifier
|
||||
String? id,
|
||||
HTTPVerb? method,
|
||||
APIType? apiType,
|
||||
AuthModel? authData,
|
||||
AuthModel? authModel,
|
||||
String? url,
|
||||
String? name,
|
||||
String? description,
|
||||
@@ -235,7 +235,6 @@ class CollectionStateNotifier
|
||||
var currentHttpRequestModel = currentModel.httpRequestModel;
|
||||
final newModel = currentModel.copyWith(
|
||||
apiType: apiType ?? currentModel.apiType,
|
||||
authModel: authData ?? currentModel.authModel,
|
||||
name: name ?? currentModel.name,
|
||||
description: description ?? currentModel.description,
|
||||
requestTabIndex: requestTabIndex ?? currentModel.requestTabIndex,
|
||||
@@ -244,6 +243,7 @@ class CollectionStateNotifier
|
||||
url: url ?? currentHttpRequestModel.url,
|
||||
headers: headers ?? currentHttpRequestModel.headers,
|
||||
params: params ?? currentHttpRequestModel.params,
|
||||
authModel: authModel ?? currentHttpRequestModel.authModel,
|
||||
isHeaderEnabledList:
|
||||
isHeaderEnabledList ?? currentHttpRequestModel.isHeaderEnabledList,
|
||||
isParamEnabledList:
|
||||
@@ -316,7 +316,7 @@ class CollectionStateNotifier
|
||||
var responseRec = await sendHttpRequest(
|
||||
requestId,
|
||||
apiType,
|
||||
requestModel.authModel,
|
||||
requestModel.httpRequestModel?.authModel,
|
||||
substitutedHttpRequestModel,
|
||||
defaultUriScheme: defaultUriScheme,
|
||||
noSSL: noSSL,
|
||||
@@ -358,7 +358,7 @@ class CollectionStateNotifier
|
||||
httpResponseModel: httpResponseModel,
|
||||
preRequestScript: requestModel.preRequestScript,
|
||||
postRequestScript: requestModel.postRequestScript,
|
||||
authModel: requestModel.authModel,
|
||||
authModel: requestModel.httpRequestModel?.authModel,
|
||||
);
|
||||
|
||||
ref.read(historyMetaStateNotifier.notifier).addHistoryRequest(model);
|
||||
|
||||
@@ -33,10 +33,10 @@ class EditAuthType extends ConsumerWidget {
|
||||
}
|
||||
|
||||
currentAuthType = ref.watch(
|
||||
selectedRequestModelProvider
|
||||
.select((request) => request?.authModel?.type ?? APIAuthType.none),
|
||||
selectedRequestModelProvider.select((request) =>
|
||||
request?.httpRequestModel?.authModel?.type ?? APIAuthType.none),
|
||||
);
|
||||
currentAuthData = selectedRequest.authModel;
|
||||
currentAuthData = selectedRequest.httpRequestModel?.authModel;
|
||||
}
|
||||
return SingleChildScrollView(
|
||||
child: Padding(
|
||||
@@ -93,7 +93,8 @@ class EditAuthType extends ConsumerWidget {
|
||||
ref.read(selectedRequestModelProvider);
|
||||
if (newType != null) {
|
||||
ref.read(collectionStateNotifierProvider.notifier).update(
|
||||
authData: selectedRequest?.authModel
|
||||
authModel: selectedRequest
|
||||
?.httpRequestModel?.authModel
|
||||
?.copyWith(type: newType) ??
|
||||
AuthModel(type: newType),
|
||||
);
|
||||
@@ -117,11 +118,11 @@ class EditAuthType extends ConsumerWidget {
|
||||
void updateAuth(AuthModel? model) {
|
||||
if (model == null) {
|
||||
ref.read(collectionStateNotifierProvider.notifier).update(
|
||||
authData: AuthModel(type: APIAuthType.none),
|
||||
authModel: AuthModel(type: APIAuthType.none),
|
||||
);
|
||||
}
|
||||
ref.read(collectionStateNotifierProvider.notifier).update(
|
||||
authData: model,
|
||||
authModel: model,
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ class EditGraphQLRequestPane extends ConsumerWidget {
|
||||
false;
|
||||
|
||||
final hasAuth = ref.watch(selectedRequestModelProvider
|
||||
.select((value) => value?.authModel?.type != APIAuthType.none));
|
||||
.select((value) => value?.httpRequestModel?.authModel?.type != APIAuthType.none));
|
||||
|
||||
final scriptsLength = ref.watch(selectedHistoryRequestModelProvider
|
||||
.select((value) => value?.preRequestScript?.length)) ??
|
||||
|
||||
@@ -37,7 +37,7 @@ class EditRestRequestPane extends ConsumerWidget {
|
||||
0;
|
||||
|
||||
final hasAuth = ref.watch(selectedRequestModelProvider.select((value) =>
|
||||
value?.authModel?.type != APIAuthType.none));
|
||||
value?.httpRequestModel?.authModel?.type != APIAuthType.none));
|
||||
|
||||
return RequestPane(
|
||||
selectedId: selectedId,
|
||||
|
||||
@@ -48,6 +48,14 @@ packages:
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.19.1"
|
||||
crypto:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: crypto
|
||||
sha256: "1e445881f28f22d6140f181e07737b22f1e099a5e1ff94b0af2f9e4a463f4855"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "3.0.6"
|
||||
cupertino_icons:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
|
||||
@@ -5,6 +5,7 @@ import '../extensions/extensions.dart';
|
||||
import '../utils/utils.dart'
|
||||
show rowsToFormDataMapList, rowsToMap, getEnabledRows;
|
||||
import '../consts.dart';
|
||||
import 'auth/api_auth_model.dart';
|
||||
|
||||
part 'http_request_model.freezed.dart';
|
||||
part 'http_request_model.g.dart';
|
||||
@@ -19,6 +20,7 @@ class HttpRequestModel with _$HttpRequestModel {
|
||||
@Default("") String url,
|
||||
List<NameValueModel>? headers,
|
||||
List<NameValueModel>? params,
|
||||
@Default(AuthModel(type: APIAuthType.none)) AuthModel? authModel,
|
||||
List<bool>? isHeaderEnabledList,
|
||||
List<bool>? isParamEnabledList,
|
||||
@Default(ContentType.json) ContentType bodyContentType,
|
||||
|
||||
@@ -25,6 +25,7 @@ mixin _$HttpRequestModel {
|
||||
String get url => throw _privateConstructorUsedError;
|
||||
List<NameValueModel>? get headers => throw _privateConstructorUsedError;
|
||||
List<NameValueModel>? get params => throw _privateConstructorUsedError;
|
||||
AuthModel? get authModel => throw _privateConstructorUsedError;
|
||||
List<bool>? get isHeaderEnabledList => throw _privateConstructorUsedError;
|
||||
List<bool>? get isParamEnabledList => throw _privateConstructorUsedError;
|
||||
ContentType get bodyContentType => throw _privateConstructorUsedError;
|
||||
@@ -54,6 +55,7 @@ abstract class $HttpRequestModelCopyWith<$Res> {
|
||||
String url,
|
||||
List<NameValueModel>? headers,
|
||||
List<NameValueModel>? params,
|
||||
AuthModel? authModel,
|
||||
List<bool>? isHeaderEnabledList,
|
||||
List<bool>? isParamEnabledList,
|
||||
ContentType bodyContentType,
|
||||
@@ -61,6 +63,8 @@ abstract class $HttpRequestModelCopyWith<$Res> {
|
||||
String? query,
|
||||
List<FormDataModel>? formData,
|
||||
});
|
||||
|
||||
$AuthModelCopyWith<$Res>? get authModel;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@@ -82,6 +86,7 @@ class _$HttpRequestModelCopyWithImpl<$Res, $Val extends HttpRequestModel>
|
||||
Object? url = null,
|
||||
Object? headers = freezed,
|
||||
Object? params = freezed,
|
||||
Object? authModel = freezed,
|
||||
Object? isHeaderEnabledList = freezed,
|
||||
Object? isParamEnabledList = freezed,
|
||||
Object? bodyContentType = null,
|
||||
@@ -107,6 +112,10 @@ class _$HttpRequestModelCopyWithImpl<$Res, $Val extends HttpRequestModel>
|
||||
? _value.params
|
||||
: params // ignore: cast_nullable_to_non_nullable
|
||||
as List<NameValueModel>?,
|
||||
authModel: freezed == authModel
|
||||
? _value.authModel
|
||||
: authModel // ignore: cast_nullable_to_non_nullable
|
||||
as AuthModel?,
|
||||
isHeaderEnabledList: freezed == isHeaderEnabledList
|
||||
? _value.isHeaderEnabledList
|
||||
: isHeaderEnabledList // ignore: cast_nullable_to_non_nullable
|
||||
@@ -135,6 +144,20 @@ class _$HttpRequestModelCopyWithImpl<$Res, $Val extends HttpRequestModel>
|
||||
as $Val,
|
||||
);
|
||||
}
|
||||
|
||||
/// Create a copy of HttpRequestModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
$AuthModelCopyWith<$Res>? get authModel {
|
||||
if (_value.authModel == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return $AuthModelCopyWith<$Res>(_value.authModel!, (value) {
|
||||
return _then(_value.copyWith(authModel: value) as $Val);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@@ -151,6 +174,7 @@ abstract class _$$HttpRequestModelImplCopyWith<$Res>
|
||||
String url,
|
||||
List<NameValueModel>? headers,
|
||||
List<NameValueModel>? params,
|
||||
AuthModel? authModel,
|
||||
List<bool>? isHeaderEnabledList,
|
||||
List<bool>? isParamEnabledList,
|
||||
ContentType bodyContentType,
|
||||
@@ -158,6 +182,9 @@ abstract class _$$HttpRequestModelImplCopyWith<$Res>
|
||||
String? query,
|
||||
List<FormDataModel>? formData,
|
||||
});
|
||||
|
||||
@override
|
||||
$AuthModelCopyWith<$Res>? get authModel;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@@ -178,6 +205,7 @@ class __$$HttpRequestModelImplCopyWithImpl<$Res>
|
||||
Object? url = null,
|
||||
Object? headers = freezed,
|
||||
Object? params = freezed,
|
||||
Object? authModel = freezed,
|
||||
Object? isHeaderEnabledList = freezed,
|
||||
Object? isParamEnabledList = freezed,
|
||||
Object? bodyContentType = null,
|
||||
@@ -203,6 +231,10 @@ class __$$HttpRequestModelImplCopyWithImpl<$Res>
|
||||
? _value._params
|
||||
: params // ignore: cast_nullable_to_non_nullable
|
||||
as List<NameValueModel>?,
|
||||
authModel: freezed == authModel
|
||||
? _value.authModel
|
||||
: authModel // ignore: cast_nullable_to_non_nullable
|
||||
as AuthModel?,
|
||||
isHeaderEnabledList: freezed == isHeaderEnabledList
|
||||
? _value._isHeaderEnabledList
|
||||
: isHeaderEnabledList // ignore: cast_nullable_to_non_nullable
|
||||
@@ -241,6 +273,7 @@ class _$HttpRequestModelImpl extends _HttpRequestModel {
|
||||
this.url = "",
|
||||
final List<NameValueModel>? headers,
|
||||
final List<NameValueModel>? params,
|
||||
this.authModel = const AuthModel(type: APIAuthType.none),
|
||||
final List<bool>? isHeaderEnabledList,
|
||||
final List<bool>? isParamEnabledList,
|
||||
this.bodyContentType = ContentType.json,
|
||||
@@ -283,6 +316,9 @@ class _$HttpRequestModelImpl extends _HttpRequestModel {
|
||||
return EqualUnmodifiableListView(value);
|
||||
}
|
||||
|
||||
@override
|
||||
@JsonKey()
|
||||
final AuthModel? authModel;
|
||||
final List<bool>? _isHeaderEnabledList;
|
||||
@override
|
||||
List<bool>? get isHeaderEnabledList {
|
||||
@@ -324,7 +360,7 @@ class _$HttpRequestModelImpl extends _HttpRequestModel {
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'HttpRequestModel(method: $method, url: $url, headers: $headers, params: $params, isHeaderEnabledList: $isHeaderEnabledList, isParamEnabledList: $isParamEnabledList, bodyContentType: $bodyContentType, body: $body, query: $query, formData: $formData)';
|
||||
return 'HttpRequestModel(method: $method, url: $url, headers: $headers, params: $params, authModel: $authModel, isHeaderEnabledList: $isHeaderEnabledList, isParamEnabledList: $isParamEnabledList, bodyContentType: $bodyContentType, body: $body, query: $query, formData: $formData)';
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -336,6 +372,8 @@ class _$HttpRequestModelImpl extends _HttpRequestModel {
|
||||
(identical(other.url, url) || other.url == url) &&
|
||||
const DeepCollectionEquality().equals(other._headers, _headers) &&
|
||||
const DeepCollectionEquality().equals(other._params, _params) &&
|
||||
(identical(other.authModel, authModel) ||
|
||||
other.authModel == authModel) &&
|
||||
const DeepCollectionEquality().equals(
|
||||
other._isHeaderEnabledList,
|
||||
_isHeaderEnabledList,
|
||||
@@ -359,6 +397,7 @@ class _$HttpRequestModelImpl extends _HttpRequestModel {
|
||||
url,
|
||||
const DeepCollectionEquality().hash(_headers),
|
||||
const DeepCollectionEquality().hash(_params),
|
||||
authModel,
|
||||
const DeepCollectionEquality().hash(_isHeaderEnabledList),
|
||||
const DeepCollectionEquality().hash(_isParamEnabledList),
|
||||
bodyContentType,
|
||||
@@ -390,6 +429,7 @@ abstract class _HttpRequestModel extends HttpRequestModel {
|
||||
final String url,
|
||||
final List<NameValueModel>? headers,
|
||||
final List<NameValueModel>? params,
|
||||
final AuthModel? authModel,
|
||||
final List<bool>? isHeaderEnabledList,
|
||||
final List<bool>? isParamEnabledList,
|
||||
final ContentType bodyContentType,
|
||||
@@ -411,6 +451,8 @@ abstract class _HttpRequestModel extends HttpRequestModel {
|
||||
@override
|
||||
List<NameValueModel>? get params;
|
||||
@override
|
||||
AuthModel? get authModel;
|
||||
@override
|
||||
List<bool>? get isHeaderEnabledList;
|
||||
@override
|
||||
List<bool>? get isParamEnabledList;
|
||||
|
||||
@@ -18,6 +18,9 @@ _$HttpRequestModelImpl _$$HttpRequestModelImplFromJson(
|
||||
params: (json['params'] as List<dynamic>?)
|
||||
?.map((e) => NameValueModel.fromJson(Map<String, Object?>.from(e as Map)))
|
||||
.toList(),
|
||||
authModel: json['authModel'] == null
|
||||
? const AuthModel(type: APIAuthType.none)
|
||||
: AuthModel.fromJson(Map<String, dynamic>.from(json['authModel'] as Map)),
|
||||
isHeaderEnabledList: (json['isHeaderEnabledList'] as List<dynamic>?)
|
||||
?.map((e) => e as bool)
|
||||
.toList(),
|
||||
@@ -41,6 +44,7 @@ Map<String, dynamic> _$$HttpRequestModelImplToJson(
|
||||
'url': instance.url,
|
||||
'headers': instance.headers?.map((e) => e.toJson()).toList(),
|
||||
'params': instance.params?.map((e) => e.toJson()).toList(),
|
||||
'authModel': instance.authModel?.toJson(),
|
||||
'isHeaderEnabledList': instance.isHeaderEnabledList,
|
||||
'isParamEnabledList': instance.isParamEnabledList,
|
||||
'bodyContentType': _$ContentTypeEnumMap[instance.bodyContentType]!,
|
||||
|
||||
Reference in New Issue
Block a user