Update collection_providers.dart

This commit is contained in:
Ashita Prasad
2024-12-16 04:00:18 +05:30
parent 3da6716afb
commit 1ea4dd07b4

View File

@ -55,7 +55,7 @@ class CollectionStateNotifier
final Ref ref; final Ref ref;
final HiveHandler hiveHandler; final HiveHandler hiveHandler;
final baseResponseModel = const HttpResponseModel(); final baseHttpResponseModel = const HttpResponseModel();
final HttpClientManager httpClientManager; final HttpClientManager httpClientManager;
bool hasId(String id) => state?.keys.contains(id) ?? false; bool hasId(String id) => state?.keys.contains(id) ?? false;
@ -288,7 +288,7 @@ class CollectionStateNotifier
isWorking: false, isWorking: false,
); );
} else { } else {
final responseModel = baseResponseModel.fromResponse( final httpResponseModel = baseHttpResponseModel.fromResponse(
response: responseRec.$1!, response: responseRec.$1!,
time: responseRec.$2!, time: responseRec.$2!,
); );
@ -296,7 +296,7 @@ class CollectionStateNotifier
newRequestModel = requestModel.copyWith( newRequestModel = requestModel.copyWith(
responseStatus: statusCode, responseStatus: statusCode,
message: kResponseCodeReasons[statusCode], message: kResponseCodeReasons[statusCode],
httpResponseModel: responseModel, httpResponseModel: httpResponseModel,
isWorking: false, isWorking: false,
); );
String newHistoryId = getNewUuid(); String newHistoryId = getNewUuid();
@ -312,7 +312,7 @@ class CollectionStateNotifier
timeStamp: DateTime.now(), timeStamp: DateTime.now(),
), ),
httpRequestModel: substitutedHttpRequestModel, httpRequestModel: substitutedHttpRequestModel,
httpResponseModel: responseModel, httpResponseModel: httpResponseModel,
); );
ref.read(historyMetaStateNotifier.notifier).addHistoryRequest(model); ref.read(historyMetaStateNotifier.notifier).addHistoryRequest(model);
} }