|
|
|
|
@ -32,11 +32,11 @@ class InsuranceViewModel extends ChangeNotifier {
|
|
|
|
|
|
|
|
|
|
InsuranceViewModel({required this.insuranceRepo, required this.errorHandlerService});
|
|
|
|
|
|
|
|
|
|
initInsuranceProvider() {
|
|
|
|
|
initInsuranceProvider({bool isFromHomePage = false}) {
|
|
|
|
|
if (isInsuranceDataToBeLoaded) {
|
|
|
|
|
patientInsuranceList.clear();
|
|
|
|
|
isInsuranceLoading = true;
|
|
|
|
|
getPatientInsuranceDetails();
|
|
|
|
|
getPatientInsuranceDetails(isFromHomePage: isFromHomePage);
|
|
|
|
|
}
|
|
|
|
|
patientInsuranceCardHistoryList.clear();
|
|
|
|
|
isInsuranceHistoryLoading = true;
|
|
|
|
|
@ -76,12 +76,12 @@ class InsuranceViewModel extends ChangeNotifier {
|
|
|
|
|
notifyListeners();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Future<void> getPatientInsuranceDetails({Function(dynamic)? onSuccess, Function(String)? onError}) async {
|
|
|
|
|
Future<void> getPatientInsuranceDetails({bool isFromHomePage = false, Function(dynamic)? onSuccess, Function(String)? onError}) async {
|
|
|
|
|
if (!isInsuranceDataToBeLoaded) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
final result = await insuranceRepo.getPatientInsuranceDetails();
|
|
|
|
|
final result = await insuranceRepo.getPatientInsuranceDetails(isFromHomePage: isFromHomePage);
|
|
|
|
|
|
|
|
|
|
result.fold(
|
|
|
|
|
// (failure) async => await errorHandlerService.handleError(failure: failure),
|
|
|
|
|
|