Added immediate patient insurance update API

pull/190/head
Haroon Amjad 2 months ago
parent 6cc058e86d
commit d9013a1dc2

@ -195,7 +195,7 @@ class ApiClientImp implements ApiClient {
} }
// body['TokenID'] = "@dm!n"; // body['TokenID'] = "@dm!n";
// body['PatientID'] = 4774018; // body['PatientID'] = 4773989;
// body['PatientTypeID'] = 1; // body['PatientTypeID'] = 1;
// body['PatientOutSA'] = 0; // body['PatientOutSA'] = 0;
// body['SessionID'] = "45786230487560q"; // body['SessionID'] = "45786230487560q";

@ -110,8 +110,6 @@ class ApiConsts {
} }
} }
static final String sendPatientUpdateRequest = 'Services/OUTPs.svc/REST/PatientCompanyUpdate';
static final String selectDeviceImei = 'Services/Patients.svc/REST/Patient_SELECTDeviceIMEIbyIMEI'; static final String selectDeviceImei = 'Services/Patients.svc/REST/Patient_SELECTDeviceIMEIbyIMEI';
static final String checkPatientAuth = 'Services/Authentication.svc/REST/CheckPatientAuthentication'; static final String checkPatientAuth = 'Services/Authentication.svc/REST/CheckPatientAuthentication';
@ -918,6 +916,8 @@ var GET_PRESCRIPTION_INSTRUCTIONS_PDF = 'Services/ChatBot_Service.svc/REST/Chatb
const DASHBOARD = 'Services/Patients.svc/REST/PatientDashboard'; const DASHBOARD = 'Services/Patients.svc/REST/PatientDashboard';
const SEND_PATIENT_IMMEDIATE_UPDATE_INSURANCE_REQUEST = 'Services/OUTPs.svc/REST/PatientCompanyUpdate';
class ApiKeyConstants { class ApiKeyConstants {
static final String googleMapsApiKey = 'AIzaSyB6TERnxIr0yJ3qG4ULBZbu0sAD4tGqtng'; static final String googleMapsApiKey = 'AIzaSyB6TERnxIr0yJ3qG4ULBZbu0sAD4tGqtng';
} }

@ -464,7 +464,11 @@ class BookAppointmentsViewModel extends ChangeNotifier {
final result = await bookAppointmentsRepo.getLiveCareScheduleClinics(_appState.getAuthenticatedUser()!.age!, _appState.getAuthenticatedUser()!.gender!); final result = await bookAppointmentsRepo.getLiveCareScheduleClinics(_appState.getAuthenticatedUser()!.age!, _appState.getAuthenticatedUser()!.gender!);
result.fold( result.fold(
(failure) async => await errorHandlerService.handleError(failure: failure), // (failure) async => await errorHandlerService.handleError(failure: failure),
(failure) async {
isClinicsListLoading = false;
notifyListeners();
},
(apiResponse) { (apiResponse) {
if (apiResponse.messageStatus == 2) { if (apiResponse.messageStatus == 2) {
// dialogService.showErrorDialog(message: apiResponse.errorMessage!, onOkPressed: () {}); // dialogService.showErrorDialog(message: apiResponse.errorMessage!, onOkPressed: () {});

@ -89,7 +89,7 @@ class ImmediateLiveCareRepoImp implements ImmediateLiveCareRepo {
body: mapDevice, body: mapDevice,
onFailure: (error, statusCode, {messageStatus, failureType}) { onFailure: (error, statusCode, {messageStatus, failureType}) {
failure = failureType; failure = failureType;
onError!(error); // onError!(error);
}, },
onSuccess: (response, statusCode, {messageStatus, errorMessage}) { onSuccess: (response, statusCode, {messageStatus, errorMessage}) {
try { try {
@ -142,7 +142,7 @@ class ImmediateLiveCareRepoImp implements ImmediateLiveCareRepo {
body: mapDevice, body: mapDevice,
onFailure: (error, statusCode, {messageStatus, failureType}) { onFailure: (error, statusCode, {messageStatus, failureType}) {
failure = failureType; failure = failureType;
onError!(error); // onError!(error);
}, },
onSuccess: (response, statusCode, {messageStatus, errorMessage}) { onSuccess: (response, statusCode, {messageStatus, errorMessage}) {
try { try {

@ -174,13 +174,21 @@ class ImmediateLiveCareViewModel extends ChangeNotifier {
}, },
onConfirmTap: () async { onConfirmTap: () async {
Navigator.pop(GetIt.instance<NavigationService>().navigatorKey.currentContext!); Navigator.pop(GetIt.instance<NavigationService>().navigatorKey.currentContext!);
Navigator.pop(GetIt.instance<NavigationService>().navigatorKey.currentContext!);
//Call the API to attempt updating patient insurance
LoaderBottomSheet.showLoader();
myAppointmentsViewModel.sendPatientUpdateRequest(onSuccess: (val) {
LoaderBottomSheet.hideLoader();
getLiveCareImmediateAppointmentFees();
}, onError: (err) {
LoaderBottomSheet.hideLoader();
Navigator.push( Navigator.push(
GetIt.instance<NavigationService>().navigatorKey.currentContext!, GetIt.instance<NavigationService>().navigatorKey.currentContext!,
CustomPageRoute( CustomPageRoute(
page: InsuranceHomePage(), page: InsuranceHomePage(),
), ),
); );
});
}), }),
), callBackFunc: () { ), callBackFunc: () {
// Navigator.pop(GetIt.instance<NavigationService>().navigatorKey.currentContext!); // Navigator.pop(GetIt.instance<NavigationService>().navigatorKey.currentContext!);

@ -20,7 +20,8 @@ import 'models/req_model/appointment_rate_req_model.dart';
import 'models/resp_models/appointment_details_resp_model.dart'; import 'models/resp_models/appointment_details_resp_model.dart';
abstract class MyAppointmentsRepo { abstract class MyAppointmentsRepo {
Future<Either<Failure, GenericApiModel<List<PatientAppointmentHistoryResponseModel>>>> getPatientAppointments({required bool isActiveAppointment, required bool isArrivedAppointments, bool isForEyeMeasurement = false}); Future<Either<Failure, GenericApiModel<List<PatientAppointmentHistoryResponseModel>>>> getPatientAppointments(
{required bool isActiveAppointment, required bool isArrivedAppointments, bool isForEyeMeasurement = false});
Future<Either<Failure, GenericApiModel<PatientAppointmentShareResponseModel>>> getPatientShareAppointment( Future<Either<Failure, GenericApiModel<PatientAppointmentShareResponseModel>>> getPatientShareAppointment(
{required int projectID, required int clinicID, required String appointmentNo, required bool isLiveCareAppointment}); {required int projectID, required int clinicID, required String appointmentNo, required bool isLiveCareAppointment});
@ -67,14 +68,16 @@ abstract class MyAppointmentsRepo {
Future<Either<Failure, GenericApiModel<AppointmentDetails>>> getAppointmentDetails(int appointmentID, int projectID); Future<Either<Failure, GenericApiModel<AppointmentDetails>>> getAppointmentDetails(int appointmentID, int projectID);
Future<Either<Failure, GenericApiModel<void>>> sendAppointmentRate(int rate, int appointmentNo, int projectID, int doctorID, int clinicID, String note); Future<Either<Failure, GenericApiModel<void>>> sendAppointmentRate(int rate, int appointmentNo, int projectID, int doctorID, int clinicID, String note);
Future<Either<Failure, GenericApiModel<void>>> sendDoctorRate(int rate, int appointmentNo, int projectID, int doctorID, int clinicID, String note, String appoDate, String docName, String projectName, String clinicName); Future<Either<Failure, GenericApiModel<void>>> sendDoctorRate(
int rate, int appointmentNo, int projectID, int doctorID, int clinicID, String note, String appoDate, String docName, String projectName, String clinicName);
Future<Either<Failure, GenericApiModel<List<PatientQueueDetails>>>> getPatientAppointmentQueueDetails({required int appointmentNo, required int patientID}); Future<Either<Failure, GenericApiModel<List<PatientQueueDetails>>>> getPatientAppointmentQueueDetails({required int appointmentNo, required int patientID});
Future<Either<Failure, GenericApiModel<dynamic>>> convertPatientToCash({required int projectID}); Future<Either<Failure, GenericApiModel<dynamic>>> convertPatientToCash({required int projectID});
Future<Either<Failure, GenericApiModel<dynamic>>> sendPatientUpdateRequest();
} }
class MyAppointmentsRepoImp implements MyAppointmentsRepo { class MyAppointmentsRepoImp implements MyAppointmentsRepo {
@ -194,9 +197,7 @@ class MyAppointmentsRepoImp implements MyAppointmentsRepo {
"AppointmentNo": appointmentNo, "AppointmentNo": appointmentNo,
"PaymentMethodName": paymentMethodName, "PaymentMethodName": paymentMethodName,
"PaymentAmount": payedAmount == 0 ? "0" : payedAmount.toString(), "PaymentAmount": payedAmount == 0 ? "0" : payedAmount.toString(),
"PaymentDate": payedAmount == 0 ? "" : "/Date(${DateTime "PaymentDate": payedAmount == 0 ? "" : "/Date(${DateTime.now().millisecondsSinceEpoch})/",
.now()
.millisecondsSinceEpoch})/",
"PaymentReferenceNumber": payedAmount == 0 ? "" : paymentReference, "PaymentReferenceNumber": payedAmount == 0 ? "" : paymentReference,
"ProjectID": projectID, "ProjectID": projectID,
"PatientID": patientID, "PatientID": patientID,
@ -865,10 +866,8 @@ class MyAppointmentsRepoImp implements MyAppointmentsRepo {
} }
} }
@override @override
Future<Either<Failure, GenericApiModel<void>>> sendAppointmentRate(int rate, int appointmentNo, int projectID, int doctorID, int clinicID, String note) async { Future<Either<Failure, GenericApiModel<void>>> sendAppointmentRate(int rate, int appointmentNo, int projectID, int doctorID, int clinicID, String note) async {
AppointmentRate appointmentRate = AppointmentRate(); AppointmentRate appointmentRate = AppointmentRate();
appointmentRate.rate = rate; appointmentRate.rate = rate;
appointmentRate.appointmentNo = appointmentNo; appointmentRate.appointmentNo = appointmentNo;
@ -879,7 +878,6 @@ class MyAppointmentsRepoImp implements MyAppointmentsRepo {
appointmentRate.createdBy = 2; appointmentRate.createdBy = 2;
appointmentRate.editedBy = 2; appointmentRate.editedBy = 2;
try { try {
GenericApiModel<bool>? apiResponse; GenericApiModel<bool>? apiResponse;
Failure? failure; Failure? failure;
@ -908,7 +906,8 @@ class MyAppointmentsRepoImp implements MyAppointmentsRepo {
} }
@override @override
Future<Either<Failure, GenericApiModel<void>>> sendDoctorRate(int rate, int appointmentNo, int projectID, int doctorID, int clinicID, String note, String appoDate, String docName, String projectName, String clinicName) async { Future<Either<Failure, GenericApiModel<void>>> sendDoctorRate(
int rate, int appointmentNo, int projectID, int doctorID, int clinicID, String note, String appoDate, String docName, String projectName, String clinicName) async {
Map<String, dynamic> request; Map<String, dynamic> request;
request = { request = {
@ -991,4 +990,35 @@ class MyAppointmentsRepoImp implements MyAppointmentsRepo {
return Left(UnknownFailure(e.toString())); return Left(UnknownFailure(e.toString()));
} }
} }
@override
Future<Either<Failure, GenericApiModel>> sendPatientUpdateRequest() async {
Map<String, dynamic> request = {};
try {
GenericApiModel<bool>? apiResponse;
Failure? failure;
await apiClient.post(SEND_PATIENT_IMMEDIATE_UPDATE_INSURANCE_REQUEST, onFailure: (error, statusCode, {messageStatus, failureType}) {
failure = failureType;
}, onSuccess: (response, statusCode, {messageStatus, errorMessage}) {
try {
final list = (response['MessageStatus'] == 1);
apiResponse = GenericApiModel<bool>(
messageStatus: messageStatus,
statusCode: statusCode,
errorMessage: null,
data: list,
);
} catch (e) {
failure = DataParsingFailure(e.toString());
}
}, body: request);
if (failure != null) return Left(failure!);
if (apiResponse == null) return Left(ServerFailure("Unknown error"));
return Right(apiResponse!);
} catch (e) {
return Left(UnknownFailure(e.toString()));
}
}
} }

@ -54,9 +54,6 @@ class MyAppointmentsViewModel extends ChangeNotifier {
List<PatientQueueDetails> patientQueueDetailsList = []; List<PatientQueueDetails> patientQueueDetailsList = [];
late PatientQueueDetails currentPatientQueueDetails; late PatientQueueDetails currentPatientQueueDetails;
List<PatientAppointmentHistoryResponseModel> patientAppointmentsHistoryList = []; List<PatientAppointmentHistoryResponseModel> patientAppointmentsHistoryList = [];
List<PatientAppointmentHistoryResponseModel> filteredAppointmentList = []; List<PatientAppointmentHistoryResponseModel> filteredAppointmentList = [];
@ -344,10 +341,8 @@ class MyAppointmentsViewModel extends ChangeNotifier {
notifyListeners(); notifyListeners();
} }
Future<void> getPatientShareAppointment(int projectID, int clinicID, String appointmentNo, bool isLiveCareAppointment, Future<void> getPatientShareAppointment(int projectID, int clinicID, String appointmentNo, bool isLiveCareAppointment, {Function(dynamic)? onSuccess, Function(String)? onError}) async {
{Function(dynamic)? onSuccess, Function(String)? onError}) async { final result = await myAppointmentsRepo.getPatientShareAppointment(projectID: projectID, clinicID: clinicID, appointmentNo: appointmentNo, isLiveCareAppointment: isLiveCareAppointment);
final result = await myAppointmentsRepo.getPatientShareAppointment(
projectID: projectID, clinicID: clinicID, appointmentNo: appointmentNo, isLiveCareAppointment: isLiveCareAppointment);
result.fold( result.fold(
(failure) async { (failure) async {
@ -421,6 +416,15 @@ class MyAppointmentsViewModel extends ChangeNotifier {
}, },
onConfirmTap: () async { onConfirmTap: () async {
Navigator.pop(GetIt.instance<NavigationService>().navigatorKey.currentContext!); Navigator.pop(GetIt.instance<NavigationService>().navigatorKey.currentContext!);
//Call the API to attempt updating patient insurance
LoaderBottomSheet.showLoader();
sendPatientUpdateRequest(onSuccess: (val) {
LoaderBottomSheet.hideLoader();
setIsPatientAppointmentShareLoading(true);
getPatientShareAppointment(projectID, clinicID, appointmentNo, isLiveCareAppointment);
}, onError: (err) {
LoaderBottomSheet.hideLoader();
Navigator.pop(GetIt.instance<NavigationService>().navigatorKey.currentContext!); Navigator.pop(GetIt.instance<NavigationService>().navigatorKey.currentContext!);
Navigator.push( Navigator.push(
GetIt.instance<NavigationService>().navigatorKey.currentContext!, GetIt.instance<NavigationService>().navigatorKey.currentContext!,
@ -428,6 +432,7 @@ class MyAppointmentsViewModel extends ChangeNotifier {
page: InsuranceHomePage(), page: InsuranceHomePage(),
), ),
); );
});
}), }),
), callBackFunc: () { ), callBackFunc: () {
// Navigator.pop(GetIt.instance<NavigationService>().navigatorKey.currentContext!); // Navigator.pop(GetIt.instance<NavigationService>().navigatorKey.currentContext!);
@ -443,6 +448,27 @@ class MyAppointmentsViewModel extends ChangeNotifier {
); );
} }
Future<void> sendPatientUpdateRequest({Function(dynamic)? onSuccess, Function(String)? onError}) async {
final result = await myAppointmentsRepo.sendPatientUpdateRequest();
result.fold(
// (failure) async => await errorHandlerService.handleError(failure: failure),
(failure) async {
onError!(failure.message);
},
(apiResponse) {
if (apiResponse.messageStatus == 2) {
// dialogService.showErrorDialog(message: apiResponse.errorMessage!, onOkPressed: () {});
} else if (apiResponse.messageStatus == 1) {
notifyListeners();
if (onSuccess != null) {
onSuccess(apiResponse);
}
}
},
);
}
Future<void> convertPatientToCash({required int projectID, Function(dynamic)? onSuccess, Function(String)? onError}) async { Future<void> convertPatientToCash({required int projectID, Function(dynamic)? onSuccess, Function(String)? onError}) async {
final result = await myAppointmentsRepo.convertPatientToCash(projectID: projectID); final result = await myAppointmentsRepo.convertPatientToCash(projectID: projectID);
@ -465,13 +491,8 @@ class MyAppointmentsViewModel extends ChangeNotifier {
} }
Future<void> addAdvanceNumberRequest( Future<void> addAdvanceNumberRequest(
{required String advanceNumber, {required String advanceNumber, required String paymentReference, required String appointmentNo, Function(dynamic)? onSuccess, Function(String)? onError}) async {
required String paymentReference, final result = await myAppointmentsRepo.addAdvanceNumberRequest(advanceNumber: advanceNumber, paymentReference: paymentReference, appointmentNo: appointmentNo);
required String appointmentNo,
Function(dynamic)? onSuccess,
Function(String)? onError}) async {
final result =
await myAppointmentsRepo.addAdvanceNumberRequest(advanceNumber: advanceNumber, paymentReference: paymentReference, appointmentNo: appointmentNo);
result.fold( result.fold(
(failure) async => await errorHandlerService.handleError(failure: failure), (failure) async => await errorHandlerService.handleError(failure: failure),
@ -489,14 +510,8 @@ class MyAppointmentsViewModel extends ChangeNotifier {
} }
Future<void> generateAppointmentQR( Future<void> generateAppointmentQR(
{required int clinicID, {required int clinicID, required int projectID, required String appointmentNo, required int isFollowUp, Function(dynamic)? onSuccess, Function(String)? onError}) async {
required int projectID, final result = await myAppointmentsRepo.generateAppointmentQR(clinicID: clinicID, projectID: projectID, appointmentNo: appointmentNo, isFollowUp: isFollowUp);
required String appointmentNo,
required int isFollowUp,
Function(dynamic)? onSuccess,
Function(String)? onError}) async {
final result =
await myAppointmentsRepo.generateAppointmentQR(clinicID: clinicID, projectID: projectID, appointmentNo: appointmentNo, isFollowUp: isFollowUp);
result.fold( result.fold(
(failure) async => await errorHandlerService.handleError(failure: failure), (failure) async => await errorHandlerService.handleError(failure: failure),
@ -513,8 +528,7 @@ class MyAppointmentsViewModel extends ChangeNotifier {
); );
} }
Future<void> cancelAppointment( Future<void> cancelAppointment({required PatientAppointmentHistoryResponseModel patientAppointmentHistoryResponseModel, Function(dynamic)? onSuccess, Function(String)? onError}) async {
{required PatientAppointmentHistoryResponseModel patientAppointmentHistoryResponseModel, Function(dynamic)? onSuccess, Function(String)? onError}) async {
final result = await myAppointmentsRepo.cancelAppointment(patientAppointmentHistoryResponseModel: patientAppointmentHistoryResponseModel); final result = await myAppointmentsRepo.cancelAppointment(patientAppointmentHistoryResponseModel: patientAppointmentHistoryResponseModel);
result.fold( result.fold(
@ -538,8 +552,7 @@ class MyAppointmentsViewModel extends ChangeNotifier {
); );
} }
Future<void> confirmAppointment( Future<void> confirmAppointment({required PatientAppointmentHistoryResponseModel patientAppointmentHistoryResponseModel, Function(dynamic)? onSuccess, Function(String)? onError}) async {
{required PatientAppointmentHistoryResponseModel patientAppointmentHistoryResponseModel, Function(dynamic)? onSuccess, Function(String)? onError}) async {
final result = await myAppointmentsRepo.confirmAppointment(patientAppointmentHistoryResponseModel: patientAppointmentHistoryResponseModel); final result = await myAppointmentsRepo.confirmAppointment(patientAppointmentHistoryResponseModel: patientAppointmentHistoryResponseModel);
result.fold( result.fold(
@ -600,8 +613,7 @@ class MyAppointmentsViewModel extends ChangeNotifier {
required int checkInType, required int checkInType,
Function(dynamic)? onSuccess, Function(dynamic)? onSuccess,
Function(String)? onError}) async { Function(String)? onError}) async {
final result = await myAppointmentsRepo.sendCheckInNfcRequest( final result = await myAppointmentsRepo.sendCheckInNfcRequest(patientAppointmentHistoryResponseModel: patientAppointmentHistoryResponseModel, scannedCode: scannedCode, checkInType: checkInType);
patientAppointmentHistoryResponseModel: patientAppointmentHistoryResponseModel, scannedCode: scannedCode, checkInType: checkInType);
result.fold( result.fold(
(failure) async => await errorHandlerService.handleError(failure: failure), (failure) async => await errorHandlerService.handleError(failure: failure),
@ -647,12 +659,8 @@ class MyAppointmentsViewModel extends ChangeNotifier {
} }
Future<void> insertLiveCareVIDARequest( Future<void> insertLiveCareVIDARequest(
{required clientRequestID, {required clientRequestID, required PatientAppointmentHistoryResponseModel patientAppointmentHistoryResponseModel, Function(dynamic)? onSuccess, Function(String)? onError}) async {
required PatientAppointmentHistoryResponseModel patientAppointmentHistoryResponseModel, final result = await myAppointmentsRepo.insertLiveCareVIDARequest(clientRequestID: clientRequestID, patientAppointmentHistoryResponseModel: patientAppointmentHistoryResponseModel);
Function(dynamic)? onSuccess,
Function(String)? onError}) async {
final result = await myAppointmentsRepo.insertLiveCareVIDARequest(
clientRequestID: clientRequestID, patientAppointmentHistoryResponseModel: patientAppointmentHistoryResponseModel);
result.fold( result.fold(
(failure) async => await errorHandlerService.handleError(failure: failure), (failure) async => await errorHandlerService.handleError(failure: failure),
@ -928,5 +936,4 @@ class MyAppointmentsViewModel extends ChangeNotifier {
}, },
); );
} }
} }

@ -116,7 +116,7 @@ class _SelectImmediateLiveCareClinicPageState extends State<SelectImmediateLiveC
onImmediateLiveCareClinicSelected(GetLiveCareClinicListResponseModel liveCareClinic) { onImmediateLiveCareClinicSelected(GetLiveCareClinicListResponseModel liveCareClinic) {
//TODO: add implementation to show clinic schedule //TODO: add implementation to show clinic schedule
if (liveCareClinic.isOnline == 1) { // if (liveCareClinic.isOnline == 1) {
showCommonBottomSheetWithoutHeight(context, child: SelectLiveCareCallType(immediateLiveCareViewModel: immediateLiveCareViewModel), callBackFunc: () async { showCommonBottomSheetWithoutHeight(context, child: SelectLiveCareCallType(immediateLiveCareViewModel: immediateLiveCareViewModel), callBackFunc: () async {
if (immediateLiveCareViewModel.liveCareSelectedCallType != 0) { if (immediateLiveCareViewModel.liveCareSelectedCallType != 0) {
immediateLiveCareViewModel.setImmediateLiveCareSelectedClinic(liveCareClinic); immediateLiveCareViewModel.setImmediateLiveCareSelectedClinic(liveCareClinic);
@ -130,17 +130,24 @@ class _SelectImmediateLiveCareClinicPageState extends State<SelectImmediateLiveC
); );
}, onError: (err) { }, onError: (err) {
LoaderBottomSheet.hideLoader(); LoaderBottomSheet.hideLoader();
}); showCommonBottomSheetWithoutHeight(
} context,
}, title: LocaleKeys.selectLiveCareCallType.tr(), isCloseButtonVisible: true, isFullScreen: false); child: Utils.getErrorWidget(loadingText: err),
} else {
showCommonBottomSheetWithoutHeight(context,
child: Utils.getErrorWidget(
loadingText: "The selected clinic is only available between ${liveCareClinic.shiftTimings!.first.startTime} & ${liveCareClinic.shiftTimings!.first.endTime} hours."),
callBackFunc: () {}, callBackFunc: () {},
title: "", isFullScreen: false,
isCloseButtonVisible: true, isCloseButtonVisible: true,
isFullScreen: false); );
});
} }
}, title: LocaleKeys.selectLiveCareCallType.tr(), isCloseButtonVisible: true, isFullScreen: false);
// } else {
// showCommonBottomSheetWithoutHeight(context,
// child: Utils.getErrorWidget(
// loadingText: "The selected clinic is only available between ${liveCareClinic.shiftTimings!.first.startTime} & ${liveCareClinic.shiftTimings!.first.endTime} hours."),
// callBackFunc: () {},
// title: "",
// isCloseButtonVisible: true,
// isFullScreen: false);
// }
} }
} }

@ -144,7 +144,14 @@ class _SelectClinicPageState extends State<SelectClinicPage> {
padding: EdgeInsets.only(top: 24.h), padding: EdgeInsets.only(top: 24.h),
shrinkWrap: true, shrinkWrap: true,
physics: NeverScrollableScrollPhysics(), physics: NeverScrollableScrollPhysics(),
itemCount: bookAppointmentsVM.isClinicsListLoading ? 5 : bookAppointmentsVM.liveCareClinicsList.length, itemCount: bookAppointmentsVM.isClinicsListLoading
? 5
: bookAppointmentsVM.liveCareClinicsList.isNotEmpty
? bookAppointmentsVM.liveCareClinicsList.length
: 1,
// bookAppointmentsVM.isClinicsListLoading ? 5 : bookAppointmentsVM.liveCareClinicsList.length,
itemBuilder: (context, index) { itemBuilder: (context, index) {
return bookAppointmentsVM.isClinicsListLoading return bookAppointmentsVM.isClinicsListLoading
? ClinicCard( ? ClinicCard(
@ -163,14 +170,16 @@ class _SelectClinicPageState extends State<SelectClinicPage> {
duration: Duration(milliseconds: 300), duration: Duration(milliseconds: 300),
curve: Curves.easeInOut, curve: Curves.easeInOut,
decoration: RoundedRectangleBorder().toSmoothCornerDecoration(color: AppColors.whiteColor, borderRadius: 24.h, hasShadow: true), decoration: RoundedRectangleBorder().toSmoothCornerDecoration(color: AppColors.whiteColor, borderRadius: 24.h, hasShadow: true),
child: ClinicCard( child: bookAppointmentsVM.liveCareClinicsList.isNotEmpty
? ClinicCard(
bookAppointmentsVM: bookAppointmentsVM, bookAppointmentsVM: bookAppointmentsVM,
liveCareClinicsResponseModel: bookAppointmentsVM.liveCareClinicsList[index], liveCareClinicsResponseModel: bookAppointmentsVM.liveCareClinicsList[index],
clinicsListResponseModel: GetClinicsListResponseModel(), clinicsListResponseModel: GetClinicsListResponseModel(),
isLoading: bookAppointmentsVM.isClinicsListLoading, isLoading: bookAppointmentsVM.isClinicsListLoading,
).onPress(() { ).onPress(() {
onLiveCareClinicSelected(bookAppointmentsVM.liveCareClinicsList[index]); onLiveCareClinicSelected(bookAppointmentsVM.liveCareClinicsList[index]);
}), })
: Utils.getNoDataWidget(context),
), ),
), ),
), ),

Loading…
Cancel
Save