LiveCare Schedule implementation done

pull/62/head
haroon amjad 1 month ago
parent b1af9e1779
commit 344ecaba18

@ -0,0 +1,3 @@
<svg width="18" height="14" viewBox="0 0 18 14" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M7.55403 0.250001H6.69598C5.50451 0.249979 4.5346 0.249962 3.76973 0.352797C2.97174 0.460084 2.28552 0.691519 1.73852 1.23852C1.19152 1.78552 0.960084 2.47174 0.852797 3.26973C0.749962 4.0346 0.749979 5.00446 0.750001 6.19592V7.80403C0.749979 8.9955 0.749962 9.9654 0.852797 10.7303C0.960084 11.5283 1.19152 12.2145 1.73852 12.7615C2.28552 13.3085 2.97174 13.5399 3.76973 13.6472C4.53462 13.75 5.5045 13.75 6.696 13.75H7.55401C8.74551 13.75 9.71539 13.75 10.4803 13.6472C11.2783 13.5399 11.9645 13.3085 12.5115 12.7615C13.0406 12.2323 13.2745 11.5729 13.3863 10.808C13.7298 11.078 14.0404 11.3056 14.3208 11.4749C14.846 11.7922 15.5117 12.0579 16.1947 11.7194C16.8671 11.386 17.0755 10.7028 17.1622 10.0899C17.2493 9.47366 17.2493 8.64442 17.2493 7.64834V6.35366C17.2493 5.35758 17.2493 4.52834 17.1622 3.91212C17.0755 3.29915 16.8671 2.61597 16.1947 2.28264C15.5117 1.94405 14.846 2.20976 14.3208 2.52707C14.0405 2.69639 13.7299 2.92386 13.3866 3.19378C13.2748 2.42814 13.0411 1.76809 12.5115 1.23852C11.9645 0.691519 11.2783 0.460084 10.4803 0.352797C9.7154 0.249962 8.7455 0.249979 7.55403 0.250001ZM13.4957 5.03688C13.5 5.39712 13.5 5.78326 13.5 6.196V7.80401C13.5 8.2175 13.5 8.6043 13.4957 8.9651C14.2136 9.55664 14.7094 9.95725 15.0964 10.191C15.2999 10.314 15.4227 10.3584 15.4898 10.3717C15.5046 10.3746 15.5147 10.3756 15.5207 10.3759C15.5237 10.376 15.527 10.376 15.527 10.376L15.5285 10.3754C15.5298 10.3748 15.5308 10.3741 15.5316 10.3736C15.5326 10.3729 15.5331 10.3724 15.5331 10.3724C15.5352 10.3702 15.5464 10.3581 15.5624 10.3268C15.5983 10.2567 15.6425 10.1231 15.6769 9.87979C15.7474 9.38156 15.7493 8.66013 15.7493 7.58744V6.41456C15.7493 5.34186 15.7474 4.62044 15.6769 4.12221C15.6425 3.87891 15.5983 3.74533 15.5624 3.67518C15.5464 3.64392 15.5355 3.63212 15.5334 3.6299C15.5334 3.6299 15.5318 3.6282 15.5285 3.62659L15.5274 3.62604C15.5274 3.62604 15.5237 3.62597 15.5207 3.62613C15.5147 3.62643 15.5046 3.62741 15.4898 3.63035C15.4227 3.64362 15.2999 3.68801 15.0964 3.81097C14.7094 4.04475 14.2136 4.44534 13.4957 5.03688ZM7.5 4C7.5 3.58579 7.83579 3.25 8.25 3.25L9.75 3.25C10.1642 3.25 10.5 3.58579 10.5 4C10.5 4.41422 10.1642 4.75 9.75 4.75L8.25 4.75C7.83579 4.75 7.5 4.41422 7.5 4Z" fill="white"/>
</svg>

After

Width:  |  Height:  |  Size: 2.3 KiB

@ -0,0 +1,4 @@
<svg width="8" height="13" viewBox="0 0 8 13" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M3.99992 0.228516C2.7918 0.228516 1.81242 1.20789 1.81242 2.41602C1.81242 3.04229 2.13626 3.65197 2.52655 4.09024C2.72604 4.31425 2.95689 4.50994 3.19989 4.65217C3.43884 4.79203 3.71565 4.89518 3.99992 4.89518C4.28419 4.89518 4.56099 4.79203 4.79995 4.65217C5.04295 4.50994 5.2738 4.31425 5.47329 4.09024C5.86358 3.65197 6.18742 3.04229 6.18742 2.41602C6.18742 1.20789 5.20804 0.228516 3.99992 0.228516Z" fill="#2E3039"/>
<path d="M1.61723 4.36783C1.63636 4.38209 1.65653 4.40812 1.69687 4.46017C1.75478 4.53488 1.8138 4.6057 1.8731 4.67228C2.12459 4.95469 2.42491 5.21256 2.7579 5.40745C3.07856 5.59513 3.50915 5.77031 3.99992 5.77031C4.49069 5.77031 4.92128 5.59513 5.24194 5.40745C5.57493 5.21256 5.87525 4.95469 6.12674 4.67228C6.18603 4.60571 6.24504 4.5349 6.30294 4.4602C6.3434 4.408 6.36363 4.3819 6.38283 4.36761C6.4397 4.3253 6.51163 4.32078 6.57335 4.35564C6.59419 4.36741 6.61516 4.38841 6.6571 4.4304C7.62953 5.28979 8.31909 6.79331 7.70799 8.24712C7.52984 8.67092 7.11767 8.95186 6.65499 8.95186L6.49354 8.95055C6.3607 8.94948 6.29428 8.94894 6.24626 8.9863C6.19823 9.02366 6.18241 9.08817 6.15078 9.21719L5.58834 11.511C5.40816 12.2458 4.75708 12.7704 4.00002 12.7704C3.24297 12.7704 2.59188 12.2458 2.41171 11.511L1.84927 9.21719C1.81763 9.08817 1.80181 9.02366 1.75379 8.9863C1.70576 8.94894 1.63934 8.94948 1.5065 8.95055L1.34506 8.95186C0.882379 8.95186 0.470201 8.67092 0.292058 8.24712C-0.319046 6.7933 0.370548 5.28979 1.34297 4.43041C1.38478 4.38854 1.40569 4.3676 1.42646 4.35585C1.48825 4.32088 1.5603 4.32541 1.61723 4.36783Z" fill="#2E3039"/>
</svg>

After

Width:  |  Height:  |  Size: 1.6 KiB

@ -133,6 +133,8 @@ class AppAssets {
static const String minus = '$svgBasePath/minus.svg'; static const String minus = '$svgBasePath/minus.svg';
static const String home_lab_result_icon = '$svgBasePath/home_lab_result_icon.svg'; static const String home_lab_result_icon = '$svgBasePath/home_lab_result_icon.svg';
static const String visa_mastercard_icon = '$svgBasePath/visa_mastercard.svg'; static const String visa_mastercard_icon = '$svgBasePath/visa_mastercard.svg';
static const String small_livecare_icon = '$svgBasePath/small_livecare_icon.svg';
static const String walkin_appointment_icon = '$svgBasePath/walkin_appointment_icon.svg';
//bottom navigation// //bottom navigation//
static const String homeBottom = '$svgBasePath/home_bottom.svg'; static const String homeBottom = '$svgBasePath/home_bottom.svg';

@ -53,6 +53,19 @@ abstract class BookAppointmentsRepo {
Future<Either<Failure, GenericApiModel<dynamic>>> getLiveCareDoctorFreeSlots(int clinicID, int serviceID, int projectID, int doctorId, bool isBookingForLiveCare, Future<Either<Failure, GenericApiModel<dynamic>>> getLiveCareDoctorFreeSlots(int clinicID, int serviceID, int projectID, int doctorId, bool isBookingForLiveCare,
{Function(dynamic)? onSuccess, Function(String)? onError}); {Function(dynamic)? onSuccess, Function(String)? onError});
Future<Either<Failure, GenericApiModel<dynamic>>> insertSpecificAppointmentForLiveCare(
{required int docID,
required int clinicID,
required int projectID,
required String selectedTime,
required String selectedDate,
required int initialSlotDuration,
required int genderID,
required int userAge,
required int serviceID,
Function(dynamic)? onSuccess,
Function(String)? onError});
} }
class BookAppointmentsRepoImp implements BookAppointmentsRepo { class BookAppointmentsRepoImp implements BookAppointmentsRepo {
@ -580,4 +593,68 @@ class BookAppointmentsRepoImp implements BookAppointmentsRepo {
return Left(UnknownFailure(e.toString())); return Left(UnknownFailure(e.toString()));
} }
} }
@override
Future<Either<Failure, GenericApiModel>> insertSpecificAppointmentForLiveCare(
{required int docID,
required int clinicID,
required int projectID,
required String selectedTime,
required String selectedDate,
required int initialSlotDuration,
required int genderID,
required int userAge,
required int serviceID,
Function(dynamic)? onSuccess,
Function(String)? onError}) async {
Map<String, dynamic> mapDevice = {
"IsForLiveCare": true,
"ProjectID": projectID,
"ClinicID": clinicID,
"DoctorID": docID,
"ServiceID": serviceID,
"StartTime": selectedTime,
"SelectedTime": selectedTime,
"EndTime": selectedTime,
"InitialSlotDuration": initialSlotDuration,
"StrAppointmentDate": selectedDate,
"IsVirtual": false,
"BookedBy": 102,
"VisitType": 1,
"VisitFor": 1,
"GenderID": genderID,
"Age": userAge
};
try {
GenericApiModel<dynamic>? apiResponse;
Failure? failure;
await apiClient.post(
INSERT_LIVECARE_SCHEDULE_APPOINTMENT,
body: mapDevice,
onFailure: (error, statusCode, {messageStatus, failureType}) {
failure = failureType;
},
onSuccess: (response, statusCode, {messageStatus, errorMessage}) {
try {
final appointmentNo = response['AppointmentNo'];
apiResponse = GenericApiModel<dynamic>(
messageStatus: messageStatus,
statusCode: statusCode,
errorMessage: response["ErrorEndUserMessage"],
data: response,
);
} catch (e) {
failure = DataParsingFailure(e.toString());
}
},
);
if (failure != null) return Left(failure!);
if (apiResponse == null) return Left(ServerFailure("Unknown error"));
return Right(apiResponse!);
} catch (e) {
return Left(UnknownFailure(e.toString()));
}
}
} }

@ -414,18 +414,9 @@ class BookAppointmentsViewModel extends ChangeNotifier {
); );
} }
//TODO: Handle the cases for LiveCare Schedule, Dental & Laser Clinics //TODO: Handle the cases for Dental & Laser Clinics
Future<void> insertSpecificAppointment( Future<void> insertSpecificAppointment(
{ {String? procedureID,
// required int docID,
// required int clinicID,
// required int projectID,
// required String selectedTime,
// required String selectedDate,
// required int initialSlotDuration,
// required int genderID,
// required int userAge,
String? procedureID,
num? testTypeEnum, num? testTypeEnum,
num? testProcedureEnum, num? testProcedureEnum,
int? invoiceNumber, int? invoiceNumber,
@ -527,6 +518,102 @@ class BookAppointmentsViewModel extends ChangeNotifier {
); );
} }
Future<void> insertSpecificAppointmentForLiveCare({Function(dynamic p1)? onSuccess, Function(dynamic p1)? onError}) async {
_appState = getIt<AppState>();
final result = await bookAppointmentsRepo.insertSpecificAppointmentForLiveCare(
docID: selectedDoctor.doctorID!,
clinicID: selectedDoctor.clinicID!,
projectID: selectedDoctor.projectID!,
serviceID: selectedLiveCareClinic.serviceID!,
selectedDate: selectedAppointmentDate,
selectedTime: selectedAppointmentTime,
initialSlotDuration: initialSlotDuration,
genderID: _appState.getAuthenticatedUser()!.gender!,
userAge: _appState.getAuthenticatedUser()!.age!,
onError: onError);
result.fold(
(failure) async {
print(failure);
},
(apiResponse) {
if (apiResponse.messageStatus == 2) {
// onError!(apiResponse);
LoadingUtils.hideFullScreenLoader();
showCommonBottomSheetWithoutHeight(
title: LocaleKeys.notice.tr(context: navigationService.navigatorKey.currentContext!),
navigationService.navigatorKey.currentContext!,
child: Utils.getWarningWidget(
loadingText: apiResponse.data["ErrorEndUserMessage"],
isShowActionButtons: true,
onCancelTap: () {
navigationService.pop();
},
onConfirmTap: () async {
navigationService.pop();
PatientAppointmentHistoryResponseModel patientAppointmentHistoryResponseModel = PatientAppointmentHistoryResponseModel(
appointmentNo: apiResponse.data["SameClinicApptList"][0]['AppointmentNo'],
clinicID: apiResponse.data["SameClinicApptList"][0]['ClinicID'],
projectID: apiResponse.data["SameClinicApptList"][0]['ProjectID'],
endDate: apiResponse.data["SameClinicApptList"][0]['EndTime'],
startTime: apiResponse.data["SameClinicApptList"][0]['StartTime'],
doctorID: apiResponse.data["SameClinicApptList"][0]['DoctorID'],
isLiveCareAppointment: apiResponse.data["SameClinicApptList"][0]['IsLiveCareAppointment'],
originalClinicID: 0,
originalProjectID: 0,
appointmentDate: apiResponse.data["SameClinicApptList"][0]['AppointmentDate'],
);
showCommonBottomSheet(navigationService.navigatorKey.currentContext!,
child: Utils.getLoadingWidget(loadingText: "Cancelling your previous appointment....".needTranslation),
callBackFunc: (str) {},
title: "",
height: ResponsiveExtension.screenHeight * 0.3,
isCloseButtonVisible: false,
isDismissible: false,
isFullScreen: false);
await cancelAppointment(patientAppointmentHistoryResponseModel: patientAppointmentHistoryResponseModel).then((val) async {
navigationService.pop();
Future.delayed(Duration(milliseconds: 50)).then((value) async {});
LoadingUtils.showFullScreenLoader(barrierDismissible: true, isSuccessDialog: false, loadingText: "Booking your appointment...".needTranslation);
await insertSpecificAppointment(
onError: (err) {},
onSuccess: (apiResp) async {
LoadingUtils.hideFullScreenLoader();
await Future.delayed(Duration(milliseconds: 50)).then((value) async {
LoadingUtils.showFullScreenLoader(barrierDismissible: true, isSuccessDialog: true, loadingText: LocaleKeys.appointmentSuccess.tr());
await Future.delayed(Duration(milliseconds: 4000)).then((value) {
LoadingUtils.hideFullScreenLoader();
Navigator.pushAndRemoveUntil(
navigationService.navigatorKey.currentContext!,
CustomPageRoute(
page: LandingNavigation(),
),
(r) => false);
});
});
});
});
}),
callBackFunc: () {},
isFullScreen: false,
isCloseButtonVisible: true,
);
} else if (apiResponse.messageStatus == 1) {
if (apiResponse.data == null || apiResponse.data!.isEmpty) {
onError!("No free slots available".tr());
return;
}
notifyListeners();
if (onSuccess != null) {
onSuccess(apiResponse);
}
}
},
);
}
Future<void> getRegionMappedProjectList() async { Future<void> getRegionMappedProjectList() async {
isRegionListLoading = true; isRegionListLoading = true;
notifyListeners(); notifyListeners();

@ -1,10 +1,13 @@
import 'dart:io';
import 'package:dartz/dartz.dart'; import 'package:dartz/dartz.dart';
import 'package:hmg_patient_app_new/core/api/api_client.dart'; import 'package:hmg_patient_app_new/core/api/api_client.dart';
import 'package:hmg_patient_app_new/core/api_consts.dart'; import 'package:hmg_patient_app_new/core/api_consts.dart';
import 'package:hmg_patient_app_new/core/cache_consts.dart';
import 'package:hmg_patient_app_new/core/common_models/generic_api_model.dart'; import 'package:hmg_patient_app_new/core/common_models/generic_api_model.dart';
import 'package:hmg_patient_app_new/core/exceptions/api_failure.dart'; import 'package:hmg_patient_app_new/core/exceptions/api_failure.dart';
import 'package:hmg_patient_app_new/features/my_appointments/models/resp_models/hospital_model.dart' import 'package:hmg_patient_app_new/core/utils/utils.dart';
show HospitalsModel; import 'package:hmg_patient_app_new/features/my_appointments/models/resp_models/hospital_model.dart' show HospitalsModel;
import 'package:hmg_patient_app_new/features/my_appointments/models/resp_models/patient_appointment_history_response_model.dart'; import 'package:hmg_patient_app_new/features/my_appointments/models/resp_models/patient_appointment_history_response_model.dart';
import 'package:hmg_patient_app_new/features/my_appointments/models/resp_models/patient_appointment_share_response_model.dart'; import 'package:hmg_patient_app_new/features/my_appointments/models/resp_models/patient_appointment_share_response_model.dart';
import 'package:hmg_patient_app_new/services/logger_service.dart'; import 'package:hmg_patient_app_new/services/logger_service.dart';
@ -12,7 +15,8 @@ import 'package:hmg_patient_app_new/services/logger_service.dart';
abstract class MyAppointmentsRepo { abstract class MyAppointmentsRepo {
Future<Either<Failure, GenericApiModel<List<PatientAppointmentHistoryResponseModel>>>> getPatientAppointments({required bool isActiveAppointment, required bool isArrivedAppointments}); Future<Either<Failure, GenericApiModel<List<PatientAppointmentHistoryResponseModel>>>> getPatientAppointments({required bool isActiveAppointment, required bool isArrivedAppointments});
Future<Either<Failure, GenericApiModel<PatientAppointmentShareResponseModel>>> getPatientShareAppointment({required int projectID, required int clinicID, required String appointmentNo}); Future<Either<Failure, GenericApiModel<PatientAppointmentShareResponseModel>>> getPatientShareAppointment(
{required int projectID, required int clinicID, required String appointmentNo, required bool isLiveCareAppointment});
Future<Either<Failure, GenericApiModel<dynamic>>> createAdvancePayment( Future<Either<Failure, GenericApiModel<dynamic>>> createAdvancePayment(
{required String paymentMethodName, {required String paymentMethodName,
@ -39,7 +43,7 @@ abstract class MyAppointmentsRepo {
Future<Either<Failure, GenericApiModel<List<PatientAppointmentHistoryResponseModel>>>> getPatientDoctorsList(); Future<Either<Failure, GenericApiModel<List<PatientAppointmentHistoryResponseModel>>>> getPatientDoctorsList();
Future<Either<Failure, GenericApiModel<dynamic>>> insertLiveCareVIDARequest({required clientRequestID, required PatientAppointmentHistoryResponseModel patientAppointmentHistoryResponseModel});
} }
class MyAppointmentsRepoImp implements MyAppointmentsRepo { class MyAppointmentsRepoImp implements MyAppointmentsRepo {
@ -99,14 +103,15 @@ class MyAppointmentsRepoImp implements MyAppointmentsRepo {
} }
@override @override
Future<Either<Failure, GenericApiModel<PatientAppointmentShareResponseModel>>> getPatientShareAppointment({required int projectID, required int clinicID, required String appointmentNo}) async { Future<Either<Failure, GenericApiModel<PatientAppointmentShareResponseModel>>> getPatientShareAppointment(
Map<String, dynamic> mapRequest = {"ProjectID": projectID, "ClinicID": clinicID, "AppointmentNo": appointmentNo, "IsActiveAppointment": true}; {required int projectID, required int clinicID, required String appointmentNo, required bool isLiveCareAppointment}) async {
Map<String, dynamic> mapRequest = {"ProjectID": projectID, "ClinicID": clinicID, "AppointmentNo": appointmentNo, "IsActiveAppointment": true, "IsForLiveCare": isLiveCareAppointment};
try { try {
GenericApiModel<PatientAppointmentShareResponseModel>? apiResponse; GenericApiModel<PatientAppointmentShareResponseModel>? apiResponse;
Failure? failure; Failure? failure;
await apiClient.post( await apiClient.post(
GET_PATIENT_SHARE, isLiveCareAppointment ? GET_PATIENT_SHARE_LIVECARE : GET_PATIENT_SHARE,
body: mapRequest, body: mapRequest,
onFailure: (error, statusCode, {messageStatus, failureType}) { onFailure: (error, statusCode, {messageStatus, failureType}) {
failure = failureType; failure = failureType;
@ -495,4 +500,50 @@ class MyAppointmentsRepoImp implements MyAppointmentsRepo {
return Left(UnknownFailure(e.toString())); return Left(UnknownFailure(e.toString()));
} }
} }
@override
Future<Either<Failure, GenericApiModel>> insertLiveCareVIDARequest({required clientRequestID, required PatientAppointmentHistoryResponseModel patientAppointmentHistoryResponseModel}) async {
Map<String, dynamic> requestBody = {
"AppointmentNo": patientAppointmentHistoryResponseModel.appointmentNo,
"AppointmentDate": patientAppointmentHistoryResponseModel.appointmentDate,
"ClientRequestID": clientRequestID,
"ClinicID": patientAppointmentHistoryResponseModel.clinicID,
"ProjectID": patientAppointmentHistoryResponseModel.projectID,
"ServiceID": patientAppointmentHistoryResponseModel.serviceID,
"AcceptedBy": patientAppointmentHistoryResponseModel.doctorID,
"IsFlutter": true,
"DeviceToken": await Utils.getStringFromPrefs(CacheConst.pushToken),
"VoipToken": "", // TODO: Add VoIP Token functionality
"IsVoip": Platform.isIOS ? true : false
};
try {
GenericApiModel<dynamic>? apiResponse;
Failure? failure;
await apiClient.post(
INSERT_VIDA_REQUEST,
body: requestBody,
onFailure: (error, statusCode, {messageStatus, failureType}) {
failure = failureType;
},
onSuccess: (response, statusCode, {messageStatus, errorMessage}) {
try {
apiResponse = GenericApiModel<dynamic>(
messageStatus: messageStatus,
statusCode: statusCode,
errorMessage: null,
data: response,
);
} catch (e) {
failure = DataParsingFailure(e.toString());
}
},
);
if (failure != null) return Left(failure!);
if (apiResponse == null) return Left(ServerFailure("Unknown error"));
return Right(apiResponse!);
} catch (e) {
return Left(UnknownFailure(e.toString()));
}
}
} }

@ -79,7 +79,6 @@ class MyAppointmentsViewModel extends ChangeNotifier {
} }
Future<void> getPatientAppointments(bool isActiveAppointment, bool isArrivedAppointments, {Function(dynamic)? onSuccess, Function(String)? onError}) async { Future<void> getPatientAppointments(bool isActiveAppointment, bool isArrivedAppointments, {Function(dynamic)? onSuccess, Function(String)? onError}) async {
patientAppointmentsHistoryList.clear(); patientAppointmentsHistoryList.clear();
patientUpcomingAppointmentsHistoryList.clear(); patientUpcomingAppointmentsHistoryList.clear();
patientArrivedAppointmentsHistoryList.clear(); patientArrivedAppointmentsHistoryList.clear();
@ -127,8 +126,8 @@ class MyAppointmentsViewModel extends ChangeNotifier {
print('All Appointments: ${patientAppointmentsHistoryList.length}'); print('All Appointments: ${patientAppointmentsHistoryList.length}');
} }
Future<void> getPatientShareAppointment(int projectID, int clinicID, String appointmentNo, {Function(dynamic)? onSuccess, Function(String)? onError}) async { Future<void> getPatientShareAppointment(int projectID, int clinicID, String appointmentNo, bool isLiveCareAppointment, {Function(dynamic)? onSuccess, Function(String)? onError}) async {
final result = await myAppointmentsRepo.getPatientShareAppointment(projectID: projectID, clinicID: clinicID, appointmentNo: appointmentNo); final result = await myAppointmentsRepo.getPatientShareAppointment(projectID: projectID, clinicID: clinicID, appointmentNo: appointmentNo, isLiveCareAppointment: isLiveCareAppointment);
result.fold( result.fold(
(failure) async => await errorHandlerService.handleError(failure: failure), (failure) async => await errorHandlerService.handleError(failure: failure),
@ -305,4 +304,24 @@ class MyAppointmentsViewModel extends ChangeNotifier {
}, },
); );
} }
Future<void> insertLiveCareVIDARequest(
{required clientRequestID, required PatientAppointmentHistoryResponseModel patientAppointmentHistoryResponseModel, Function(dynamic)? onSuccess, Function(String)? onError}) async {
final result = await myAppointmentsRepo.insertLiveCareVIDARequest(clientRequestID: clientRequestID, patientAppointmentHistoryResponseModel: patientAppointmentHistoryResponseModel);
result.fold(
(failure) async => await errorHandlerService.handleError(failure: failure),
(apiResponse) {
if (apiResponse.messageStatus == 2) {
onError!(apiResponse.errorMessage!);
// dialogService.showErrorDialog(message: apiResponse.errorMessage!, onOkPressed: () {});
} else if (apiResponse.messageStatus == 1) {
notifyListeners();
if (onSuccess != null) {
onSuccess(apiResponse);
}
}
},
);
}
} }

@ -81,29 +81,6 @@ class _AppointmentDetailsPageState extends State<AppointmentDetailsPage> {
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
// Row(
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
// children: [
// "Appointment Details".needTranslation.toText20(isBold: true),
// if (AppointmentType.isArrived(widget.patientAppointmentHistoryResponseModel))
// CustomButton(
// text: "Report".needTranslation,
// onPressed: () {},
// backgroundColor: AppColors.secondaryLightRedColor,
// borderColor: AppColors.secondaryLightRedColor,
// textColor: AppColors.primaryRedColor,
// fontSize: 14,
// fontWeight: FontWeight.w500,
// borderRadius: 12,
// padding: EdgeInsets.fromLTRB(10, 0, 10, 0),
// height: 40.h,
// iconSize: 16.h,
// icon: AppAssets.report_icon,
// iconColor: AppColors.primaryRedColor,
// )
// ],
// ),
// SizedBox(height: 24.h),
AppointmentDoctorCard( AppointmentDoctorCard(
patientAppointmentHistoryResponseModel: widget.patientAppointmentHistoryResponseModel, patientAppointmentHistoryResponseModel: widget.patientAppointmentHistoryResponseModel,
onAskDoctorTap: () {}, onAskDoctorTap: () {},
@ -162,42 +139,60 @@ class _AppointmentDetailsPageState extends State<AppointmentDetailsPage> {
? "Not Confirmed".needTranslation.toText12(color: AppColors.primaryRedColor, fontWeight: FontWeight.w500) ? "Not Confirmed".needTranslation.toText12(color: AppColors.primaryRedColor, fontWeight: FontWeight.w500)
: "Confirmed".needTranslation.toText12(color: AppColors.successColor, fontWeight: FontWeight.w500)), : "Confirmed".needTranslation.toText12(color: AppColors.successColor, fontWeight: FontWeight.w500)),
SizedBox(height: 16.h), SizedBox(height: 16.h),
Stack( widget.patientAppointmentHistoryResponseModel.isLiveCareAppointment ?? false
children: [ ? Row(
ClipRRect( children: [
clipBehavior: Clip.hardEdge, Utils.buildSvgWithAssets(icon: AppAssets.livecare_clinic_icon, width: 58.h, height: 58.h),
borderRadius: BorderRadius.circular(24), SizedBox(width: 18.h),
child: Image.network( Expanded(
"https://maps.googleapis.com/maps/api/staticmap?center=${widget.patientAppointmentHistoryResponseModel.latitude},${widget.patientAppointmentHistoryResponseModel.longitude}&zoom=14&size=350x165&maptype=roadmap&markers=color:red%7C${widget.patientAppointmentHistoryResponseModel.latitude},${widget.patientAppointmentHistoryResponseModel.longitude}&key=AIzaSyB6TERnxIr0yJ3qG4ULBZbu0sAD4tGqtng", child: Column(
fit: BoxFit.contain, crossAxisAlignment: CrossAxisAlignment.start,
), children: [
), "LiveCare Appointment".toText18(color: AppColors.textColor, isBold: true),
Positioned( "The doctor will call you once the appointment time approaches."
bottom: 0, .needTranslation
child: SizedBox( .toText14(color: AppColors.greyTextColor, weight: FontWeight.w500),
width: MediaQuery.of(context).size.width * 0.785, ],
child: CustomButton( ),
text: "Get Directions".needTranslation, ),
onPressed: () { ],
MapsLauncher.launchCoordinates(double.parse(widget.patientAppointmentHistoryResponseModel.latitude!), )
double.parse(widget.patientAppointmentHistoryResponseModel.longitude!), widget.patientAppointmentHistoryResponseModel.projectName); : Stack(
}, children: [
backgroundColor: AppColors.textColor.withOpacity(0.8), ClipRRect(
borderColor: AppointmentType.getNextActionButtonColor(widget.patientAppointmentHistoryResponseModel.nextAction).withOpacity(0.01), clipBehavior: Clip.hardEdge,
textColor: AppColors.whiteColor, borderRadius: BorderRadius.circular(24),
fontSize: 14, child: Image.network(
fontWeight: FontWeight.w500, "https://maps.googleapis.com/maps/api/staticmap?center=${widget.patientAppointmentHistoryResponseModel.latitude},${widget.patientAppointmentHistoryResponseModel.longitude}&zoom=14&size=350x165&maptype=roadmap&markers=color:red%7C${widget.patientAppointmentHistoryResponseModel.latitude},${widget.patientAppointmentHistoryResponseModel.longitude}&key=AIzaSyB6TERnxIr0yJ3qG4ULBZbu0sAD4tGqtng",
borderRadius: 12.h, fit: BoxFit.contain,
padding: EdgeInsets.fromLTRB(10, 0, 10, 0), ),
height: 40.h, ),
icon: AppAssets.directions_icon, Positioned(
iconColor: AppColors.whiteColor, bottom: 0,
iconSize: 13.h, child: SizedBox(
).paddingAll(12.h), width: MediaQuery.of(context).size.width * 0.785,
child: CustomButton(
text: "Get Directions".needTranslation,
onPressed: () {
MapsLauncher.launchCoordinates(double.parse(widget.patientAppointmentHistoryResponseModel.latitude!),
double.parse(widget.patientAppointmentHistoryResponseModel.longitude!), widget.patientAppointmentHistoryResponseModel.projectName);
},
backgroundColor: AppColors.textColor.withOpacity(0.8),
borderColor: AppointmentType.getNextActionButtonColor(widget.patientAppointmentHistoryResponseModel.nextAction).withOpacity(0.01),
textColor: AppColors.whiteColor,
fontSize: 14,
fontWeight: FontWeight.w500,
borderRadius: 12.h,
padding: EdgeInsets.fromLTRB(10, 0, 10, 0),
height: 40.h,
icon: AppAssets.directions_icon,
iconColor: AppColors.whiteColor,
iconSize: 13.h,
).paddingAll(12.h),
),
),
],
), ),
),
],
),
], ],
), ),
), ),

@ -27,9 +27,8 @@ import 'package:hmg_patient_app_new/theme/colors.dart';
import 'package:hmg_patient_app_new/widgets/buttons/custom_button.dart'; import 'package:hmg_patient_app_new/widgets/buttons/custom_button.dart';
import 'package:hmg_patient_app_new/widgets/common_bottom_sheet.dart'; import 'package:hmg_patient_app_new/widgets/common_bottom_sheet.dart';
import 'package:hmg_patient_app_new/widgets/in_app_browser/InAppBrowser.dart'; import 'package:hmg_patient_app_new/widgets/in_app_browser/InAppBrowser.dart';
import 'package:hmg_patient_app_new/widgets/loader/bottomsheet_loader.dart';
import 'package:hmg_patient_app_new/widgets/routes/custom_page_route.dart'; import 'package:hmg_patient_app_new/widgets/routes/custom_page_route.dart';
import 'package:hmg_patient_app_new/widgets/shimmer/movies_shimmer_widget.dart';
import 'package:hmg_patient_app_new/widgets/transitions/fade_page.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:smooth_corner/smooth_corner.dart'; import 'package:smooth_corner/smooth_corner.dart';
@ -61,6 +60,7 @@ class _AppointmentPaymentPageState extends State<AppointmentPaymentPage> {
widget.patientAppointmentHistoryResponseModel.projectID, widget.patientAppointmentHistoryResponseModel.projectID,
widget.patientAppointmentHistoryResponseModel.clinicID, widget.patientAppointmentHistoryResponseModel.clinicID,
widget.patientAppointmentHistoryResponseModel.appointmentNo.toString(), widget.patientAppointmentHistoryResponseModel.appointmentNo.toString(),
widget.patientAppointmentHistoryResponseModel.isLiveCareAppointment ?? false,
); );
}); });
super.initState(); super.initState();
@ -361,8 +361,7 @@ class _AppointmentPaymentPageState extends State<AppointmentPaymentPage> {
} }
void checkPaymentStatus() async { void checkPaymentStatus() async {
showCommonBottomSheet(context, LoaderBottomSheet.showLoader();
child: Utils.getLoadingWidget(), callBackFunc: (str) {}, title: "", height: ResponsiveExtension.screenHeight * 0.3, isCloseButtonVisible: false, isDismissible: false, isFullScreen: false);
await payfortViewModel.checkPaymentStatus( await payfortViewModel.checkPaymentStatus(
transactionID: transID, transactionID: transID,
onSuccess: (apiResponse) async { onSuccess: (apiResponse) async {
@ -388,6 +387,21 @@ class _AppointmentPaymentPageState extends State<AppointmentPaymentPage> {
onSuccess: (value) async { onSuccess: (value) async {
if (widget.patientAppointmentHistoryResponseModel.isLiveCareAppointment!) { if (widget.patientAppointmentHistoryResponseModel.isLiveCareAppointment!) {
//TODO: Implement LiveCare Check-In API Call //TODO: Implement LiveCare Check-In API Call
await myAppointmentsViewModel.insertLiveCareVIDARequest(
clientRequestID: transID,
patientAppointmentHistoryResponseModel: widget.patientAppointmentHistoryResponseModel,
onSuccess: (apiResponse) {
Future.delayed(Duration(milliseconds: 500), () {
LoaderBottomSheet.hideLoader();
Navigator.pushAndRemoveUntil(
context,
CustomPageRoute(
page: LandingNavigation(),
),
(r) => false);
});
},
onError: (error) {});
} else { } else {
await myAppointmentsViewModel.generateAppointmentQR( await myAppointmentsViewModel.generateAppointmentQR(
clinicID: widget.patientAppointmentHistoryResponseModel.clinicID, clinicID: widget.patientAppointmentHistoryResponseModel.clinicID,
@ -396,16 +410,16 @@ class _AppointmentPaymentPageState extends State<AppointmentPaymentPage> {
isFollowUp: myAppointmentsViewModel.patientAppointmentShareResponseModel!.isFollowup!, isFollowUp: myAppointmentsViewModel.patientAppointmentShareResponseModel!.isFollowup!,
onSuccess: (apiResponse) { onSuccess: (apiResponse) {
Future.delayed(Duration(milliseconds: 500), () { Future.delayed(Duration(milliseconds: 500), () {
Navigator.of(context).pop(); LoaderBottomSheet.hideLoader();
Navigator.pushAndRemoveUntil( Navigator.pushAndRemoveUntil(
context, context,
CustomPageRoute( CustomPageRoute(
page: LandingNavigation(), page: LandingNavigation(),
), ),
(r) => false); (r) => false);
Navigator.of(context).push( // Navigator.of(context).push(
CustomPageRoute(page: MyAppointmentsPage()), // CustomPageRoute(page: MyAppointmentsPage()),
); // );
}); });
}); });
} }

@ -18,6 +18,7 @@ import 'package:hmg_patient_app_new/widgets/buttons/custom_button.dart';
import 'package:hmg_patient_app_new/widgets/chip/app_custom_chip_widget.dart'; import 'package:hmg_patient_app_new/widgets/chip/app_custom_chip_widget.dart';
import 'package:hmg_patient_app_new/widgets/routes/custom_page_route.dart'; import 'package:hmg_patient_app_new/widgets/routes/custom_page_route.dart';
import 'package:hmg_patient_app_new/widgets/transitions/fade_page.dart'; import 'package:hmg_patient_app_new/widgets/transitions/fade_page.dart';
import 'package:smooth_corner/smooth_corner.dart';
class AppointmentCard extends StatefulWidget { class AppointmentCard extends StatefulWidget {
AppointmentCard({super.key, required this.patientAppointmentHistoryResponseModel, required this.myAppointmentsViewModel, this.isLoading = false, this.isFromHomePage = false}); AppointmentCard({super.key, required this.patientAppointmentHistoryResponseModel, required this.myAppointmentsViewModel, this.isLoading = false, this.isFromHomePage = false});
@ -63,44 +64,38 @@ class _AppointmentCardState extends State<AppointmentCard> {
spacing: 6.h, spacing: 6.h,
runSpacing: 6.h, runSpacing: 6.h,
children: [ children: [
Row( AppCustomChipWidget(
mainAxisSize: MainAxisSize.min, icon: widget.isLoading
children: [ ? AppAssets.walkin_appointment_icon
CustomButton( : (!widget.patientAppointmentHistoryResponseModel.isLiveCareAppointment! ? AppAssets.walkin_appointment_icon : AppAssets.small_livecare_icon),
text: widget.isLoading iconColor: widget.isLoading
? "OutPatient" ? AppColors.textColor
: appState.isArabic() : !widget.patientAppointmentHistoryResponseModel.isLiveCareAppointment!
? widget.patientAppointmentHistoryResponseModel.isInOutPatientDescriptionN! ? AppColors.textColor
: widget.patientAppointmentHistoryResponseModel.isInOutPatientDescription!, : AppColors.whiteColor,
onPressed: () {}, labelText: widget.isLoading
backgroundColor: AppColors.primaryRedColor.withOpacity(0.1), ? "Walk In"
borderColor: AppColors.primaryRedColor.withOpacity(0.0), : widget.patientAppointmentHistoryResponseModel.isLiveCareAppointment!
textColor: AppColors.primaryRedColor, ? LocaleKeys.livecare.tr(context: context)
fontSize: 10, : "Walk In".needTranslation,
fontWeight: FontWeight.w500, backgroundColor:
borderRadius: 8, widget.isLoading ? AppColors.greyColor : (!widget.patientAppointmentHistoryResponseModel.isLiveCareAppointment! ? AppColors.greyColor : AppColors.successColor),
padding: EdgeInsets.fromLTRB(10, 0, 10, 0), textColor: widget.isLoading ? AppColors.textColor : (!widget.patientAppointmentHistoryResponseModel.isLiveCareAppointment! ? AppColors.textColor : AppColors.whiteColor),
height: 30.h, ).toShimmer2(isShow: widget.isLoading),
), AppCustomChipWidget(
], labelText: widget.isLoading
), ? "OutPatient"
Row( : appState.isArabic()
mainAxisSize: MainAxisSize.min, ? widget.patientAppointmentHistoryResponseModel.isInOutPatientDescriptionN!
children: [ : widget.patientAppointmentHistoryResponseModel.isInOutPatientDescription!,
CustomButton( backgroundColor: AppColors.primaryRedColor.withOpacity(0.1),
text: widget.isLoading ? "Booked" : AppointmentType.getAppointmentStatusType(widget.patientAppointmentHistoryResponseModel.patientStatusType!), textColor: AppColors.primaryRedColor,
onPressed: () {}, ).toShimmer2(isShow: widget.isLoading),
backgroundColor: AppColors.successColor.withOpacity(0.1), AppCustomChipWidget(
borderColor: AppColors.successColor.withOpacity(0.0), labelText: widget.isLoading ? "Booked" : AppointmentType.getAppointmentStatusType(widget.patientAppointmentHistoryResponseModel.patientStatusType!),
textColor: AppColors.successColor, backgroundColor: AppColors.successColor.withOpacity(0.1),
fontSize: 10, textColor: AppColors.successColor,
fontWeight: FontWeight.w500, ).toShimmer2(isShow: widget.isLoading),
borderRadius: 8,
padding: EdgeInsets.fromLTRB(10, 0, 10, 0),
height: 30.h,
),
],
),
], ],
).toShimmer2(isShow: widget.isLoading), ).toShimmer2(isShow: widget.isLoading),
), ),

@ -59,6 +59,13 @@ class AppointmentDoctorCard extends StatelessWidget {
icon: AppAssets.doctor_calendar_icon, icon: AppAssets.doctor_calendar_icon,
labelText: labelText:
"${DateUtil.formatDateToDate(DateUtil.convertStringToDate(patientAppointmentHistoryResponseModel.appointmentDate), false)}, ${DateUtil.formatDateToTimeLang(DateUtil.convertStringToDate(patientAppointmentHistoryResponseModel.appointmentDate), false)}"), "${DateUtil.formatDateToDate(DateUtil.convertStringToDate(patientAppointmentHistoryResponseModel.appointmentDate), false)}, ${DateUtil.formatDateToTimeLang(DateUtil.convertStringToDate(patientAppointmentHistoryResponseModel.appointmentDate), false)}"),
AppCustomChipWidget(
icon: !patientAppointmentHistoryResponseModel.isLiveCareAppointment! ? AppAssets.walkin_appointment_icon : AppAssets.small_livecare_icon,
iconColor: !patientAppointmentHistoryResponseModel.isLiveCareAppointment! ? AppColors.textColor : AppColors.whiteColor,
labelText: patientAppointmentHistoryResponseModel.isLiveCareAppointment! ? LocaleKeys.livecare.tr(context: context) : "Walk In".needTranslation,
backgroundColor: !patientAppointmentHistoryResponseModel.isLiveCareAppointment! ? AppColors.greyColor : AppColors.successColor,
textColor: !patientAppointmentHistoryResponseModel.isLiveCareAppointment! ? AppColors.textColor : AppColors.whiteColor,
),
AppCustomChipWidget(icon: AppAssets.rating_icon, iconColor: AppColors.ratingColorYellow, labelText: "Rating: ${patientAppointmentHistoryResponseModel.decimalDoctorRate}"), AppCustomChipWidget(icon: AppAssets.rating_icon, iconColor: AppColors.ratingColorYellow, labelText: "Rating: ${patientAppointmentHistoryResponseModel.decimalDoctorRate}"),
], ],
), ),
@ -113,29 +120,8 @@ class AppointmentDoctorCard extends StatelessWidget {
iconSize: 16.h, iconSize: 16.h,
); );
} else { } else {
return Row( return patientAppointmentHistoryResponseModel.isLiveCareAppointment ?? false
children: [ ? CustomButton(
Expanded(
child: CustomButton(
text: LocaleKeys.reschedule.tr(),
onPressed: () {
onRescheduleTap();
},
backgroundColor: AppColors.secondaryLightRedColor,
borderColor: AppColors.secondaryLightRedColor,
textColor: AppColors.primaryRedColor,
fontSize: 14,
fontWeight: FontWeight.w500,
borderRadius: 12.h,
height: 40.h,
icon: AppAssets.appointment_calendar_icon,
iconColor: AppColors.primaryRedColor,
iconSize: 16.h,
),
),
SizedBox(width: 16.h),
Expanded(
child: CustomButton(
text: LocaleKeys.cancel.tr(), text: LocaleKeys.cancel.tr(),
onPressed: () { onPressed: () {
onCancelTap(); onCancelTap();
@ -150,10 +136,48 @@ class AppointmentDoctorCard extends StatelessWidget {
icon: AppAssets.cancel, icon: AppAssets.cancel,
iconColor: AppColors.whiteColor, iconColor: AppColors.whiteColor,
iconSize: 16.h, iconSize: 16.h,
), )
), : Row(
], children: [
); Expanded(
child: CustomButton(
text: LocaleKeys.reschedule.tr(),
onPressed: () {
onRescheduleTap();
},
backgroundColor: AppColors.secondaryLightRedColor,
borderColor: AppColors.secondaryLightRedColor,
textColor: AppColors.primaryRedColor,
fontSize: 14,
fontWeight: FontWeight.w500,
borderRadius: 12.h,
height: 40.h,
icon: AppAssets.appointment_calendar_icon,
iconColor: AppColors.primaryRedColor,
iconSize: 16.h,
),
),
SizedBox(width: 16.h),
Expanded(
child: CustomButton(
text: LocaleKeys.cancel.tr(),
onPressed: () {
onCancelTap();
},
backgroundColor: AppColors.primaryRedColor,
borderColor: AppColors.primaryRedColor,
textColor: AppColors.whiteColor,
fontSize: 14,
fontWeight: FontWeight.w500,
borderRadius: 12.h,
height: 40.h,
icon: AppAssets.cancel,
iconColor: AppColors.whiteColor,
iconSize: 16.h,
),
),
],
);
} }
} }
} }

@ -115,29 +115,53 @@ class DoctorProfilePage extends StatelessWidget {
text: "View available appointments".needTranslation, text: "View available appointments".needTranslation,
onPressed: () async { onPressed: () async {
LoaderBottomSheet.showLoader(); LoaderBottomSheet.showLoader();
await bookAppointmentsViewModel.getDoctorFreeSlots( bookAppointmentsViewModel.isLiveCareSchedule
isBookingForLiveCare: false, ? await bookAppointmentsViewModel.getLiveCareDoctorFreeSlots(
onSuccess: (dynamic respData) async { isBookingForLiveCare: true,
LoaderBottomSheet.hideLoader(); onSuccess: (dynamic respData) async {
showCommonBottomSheetWithoutHeight( LoaderBottomSheet.hideLoader();
title: "Pick a Date".needTranslation, showCommonBottomSheetWithoutHeight(
context, title: "Pick a Date".needTranslation,
child: AppointmentCalendar(), context,
isFullScreen: false, child: AppointmentCalendar(),
isCloseButtonVisible: true, isFullScreen: false,
callBackFunc: () {}, isCloseButtonVisible: true,
); callBackFunc: () {},
}, );
onError: (err) { },
LoaderBottomSheet.hideLoader(); onError: (err) {
showCommonBottomSheetWithoutHeight( LoaderBottomSheet.hideLoader();
context, showCommonBottomSheetWithoutHeight(
child: Utils.getErrorWidget(loadingText: err), context,
callBackFunc: () {}, child: Utils.getErrorWidget(loadingText: err),
isFullScreen: false, callBackFunc: () {},
isCloseButtonVisible: true, isFullScreen: false,
); isCloseButtonVisible: true,
}); );
})
: await bookAppointmentsViewModel.getDoctorFreeSlots(
isBookingForLiveCare: false,
onSuccess: (dynamic respData) async {
LoaderBottomSheet.hideLoader();
showCommonBottomSheetWithoutHeight(
title: "Pick a Date".needTranslation,
context,
child: AppointmentCalendar(),
isFullScreen: false,
isCloseButtonVisible: true,
callBackFunc: () {},
);
},
onError: (err) {
LoaderBottomSheet.hideLoader();
showCommonBottomSheetWithoutHeight(
context,
child: Utils.getErrorWidget(loadingText: err),
callBackFunc: () {},
isFullScreen: false,
isCloseButtonVisible: true,
);
});
}, },
backgroundColor: AppColors.primaryRedColor, backgroundColor: AppColors.primaryRedColor,
borderColor: AppColors.primaryRedColor, borderColor: AppColors.primaryRedColor,

@ -204,34 +204,46 @@ class _ReviewAppointmentPageState extends State<ReviewAppointmentPage> {
void initiateBookAppointment() async { void initiateBookAppointment() async {
LoadingUtils.showFullScreenLoader(barrierDismissible: true, isSuccessDialog: false, loadingText: "Booking your appointment...".needTranslation); LoadingUtils.showFullScreenLoader(barrierDismissible: true, isSuccessDialog: false, loadingText: "Booking your appointment...".needTranslation);
await bookAppointmentsViewModel.insertSpecificAppointment(onError: (err) { if (bookAppointmentsViewModel.isLiveCareSchedule) {
print(err.data["ErrorEndUserMessage"]); await bookAppointmentsViewModel.insertSpecificAppointmentForLiveCare(onError: (err) {
LoadingUtils.hideFullScreenLoader(); print(err.data["ErrorEndUserMessage"]);
}, onSuccess: (apiResp) async { LoadingUtils.hideFullScreenLoader();
LoadingUtils.hideFullScreenLoader(); }, onSuccess: (apiResp) async {
await Future.delayed(Duration(milliseconds: 50)).then((value) async { LoadingUtils.hideFullScreenLoader();
LoadingUtils.showFullScreenLoader(barrierDismissible: true, isSuccessDialog: true, loadingText: LocaleKeys.appointmentSuccess.tr()); await Future.delayed(Duration(milliseconds: 50)).then((value) async {
await Future.delayed(Duration(milliseconds: 4000)).then((value) { LoadingUtils.showFullScreenLoader(barrierDismissible: true, isSuccessDialog: true, loadingText: LocaleKeys.appointmentSuccess.tr());
LoadingUtils.hideFullScreenLoader(); await Future.delayed(Duration(milliseconds: 4000)).then((value) {
Navigator.pushAndRemoveUntil( LoadingUtils.hideFullScreenLoader();
context, bookAppointmentsViewModel.setIsLiveCareSchedule(false);
CustomPageRoute( Navigator.pushAndRemoveUntil(
page: LandingNavigation(), context,
), CustomPageRoute(
(r) => false); page: LandingNavigation(),
),
(r) => false);
});
}); });
}); });
}); } else {
await bookAppointmentsViewModel.insertSpecificAppointment(onError: (err) {
// await Future.delayed(Duration(milliseconds: 4000)).then((value) async { print(err.data["ErrorEndUserMessage"]);
// LoadingUtils.hideFullScreenLoader(); LoadingUtils.hideFullScreenLoader();
}, onSuccess: (apiResp) async {
// await Future.delayed(Duration(milliseconds: 50)).then((value) async { LoadingUtils.hideFullScreenLoader();
// LoadingUtils.showFullScreenLoader(barrierDismissible: true, isSuccessDialog: true, loadingText: LocaleKeys.appointmentSuccess.tr()); await Future.delayed(Duration(milliseconds: 50)).then((value) async {
// await Future.delayed(Duration(milliseconds: 4000)).then((value) { LoadingUtils.showFullScreenLoader(barrierDismissible: true, isSuccessDialog: true, loadingText: LocaleKeys.appointmentSuccess.tr());
// LoadingUtils.hideFullScreenLoader(); await Future.delayed(Duration(milliseconds: 4000)).then((value) {
// }); LoadingUtils.hideFullScreenLoader();
// }); bookAppointmentsViewModel.setIsLiveCareSchedule(false);
// }); Navigator.pushAndRemoveUntil(
context,
CustomPageRoute(
page: LandingNavigation(),
),
(r) => false);
});
});
});
}
} }
} }

@ -48,63 +48,46 @@ class AppCustomChipWidget extends StatelessWidget {
padding: EdgeInsets.all(0.0), padding: EdgeInsets.all(0.0),
shape: SmoothRectangleBorder( shape: SmoothRectangleBorder(
side: BorderSide( side: BorderSide(
width: 0.0, width: 10.0,
color: Colors.transparent, // Crucially, set color to transparent color: Colors.transparent, // Crucially, set color to transparent
style: BorderStyle.none, style: BorderStyle.none,
), ),
borderRadius: BorderRadius.circular(10.0), // Apply a border radius of 16.0 borderRadius: BorderRadius.circular(8.0), // Apply a border radius of 16.0
), ),
), ),
child: icon.isNotEmpty child: icon.isNotEmpty
? Chip( ? Chip(
avatar: icon.isNotEmpty avatar: icon.isNotEmpty ? Utils.buildSvgWithAssets(icon: icon, width: iconSize.h, height: iconSize.h, iconColor: iconHasColor ? iconColor : null) : SizedBox.shrink(),
? Utils.buildSvgWithAssets( label: richText ?? labelText!.toText10(weight: FontWeight.w500, letterSpacing: -0.64, color: textColor),
icon: icon,
width: iconSize.h,
height: iconSize.h,
iconColor: iconHasColor ? iconColor : null)
: SizedBox.shrink(),
label: richText ??
labelText!.toText10(
weight: FontWeight.w500,
letterSpacing: -0.64,
color: textColor),
// padding: EdgeInsets.all(0.0), // padding: EdgeInsets.all(0.0),
padding: padding, padding: padding,
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
labelPadding: EdgeInsetsDirectional.only( labelPadding: EdgeInsetsDirectional.only(start: -4.h, end: deleteIcon?.isNotEmpty == true ? 2.h : 8.h),
start: -4.h,
end: deleteIcon?.isNotEmpty == true ? 2.h : 8.h),
backgroundColor: backgroundColor, backgroundColor: backgroundColor,
shape: shape, shape: shape ??
SmoothRectangleBorder(
borderRadius: BorderRadius.circular(8 ?? 0),
smoothness: 10,
side: BorderSide(color: AppColors.transparent, width: 1.5),
),
deleteIcon: deleteIcon?.isNotEmpty == true deleteIcon: deleteIcon?.isNotEmpty == true
? Utils.buildSvgWithAssets( ? Utils.buildSvgWithAssets(icon: deleteIcon!, width: deleteIconSize!.width!.h, height: deleteIconSize!.height.h, iconColor: deleteIconHasColor ? deleteIconColor : null)
icon: deleteIcon!,
width: deleteIconSize!.width!.h,
height: deleteIconSize!.height.h,
iconColor: deleteIconHasColor ? deleteIconColor : null)
: null, : null,
onDeleted: deleteIcon?.isNotEmpty == true ? () {} : null, onDeleted: deleteIcon?.isNotEmpty == true ? () {} : null,
) )
: Chip( : Chip(
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
label: richText ?? label: richText ?? labelText!.toText10(weight: FontWeight.w500, letterSpacing: -0.64, color: textColor),
labelText!.toText10(
weight: FontWeight.w500,
letterSpacing: -0.64,
color: textColor),
padding: EdgeInsets.all(0.0), padding: EdgeInsets.all(0.0),
backgroundColor: backgroundColor, backgroundColor: backgroundColor,
shape: shape, shape: shape ?? SmoothRectangleBorder(
labelPadding: EdgeInsetsDirectional.only( borderRadius: BorderRadius.circular(8 ?? 0),
start: 8.h, smoothness: 10,
end: deleteIcon?.isNotEmpty == true ? -2.h : 8.h), side: BorderSide(color: AppColors.transparent, width: 1.5),
),
labelPadding: EdgeInsetsDirectional.only(start: 8.h, end: deleteIcon?.isNotEmpty == true ? -2.h : 8.h),
deleteIcon: deleteIcon?.isNotEmpty == true deleteIcon: deleteIcon?.isNotEmpty == true
? Utils.buildSvgWithAssets( ? Utils.buildSvgWithAssets(icon: deleteIcon!, width: deleteIconSize!.width.h, height: deleteIconSize!.height.h, iconColor: deleteIconHasColor ? deleteIconColor : null)
icon: deleteIcon!,
width: deleteIconSize!.width.h,
height: deleteIconSize!.height.h,
iconColor: deleteIconHasColor ? deleteIconColor : null)
: null, : null,
onDeleted: deleteIcon?.isNotEmpty == true ? () {} : null, onDeleted: deleteIcon?.isNotEmpty == true ? () {} : null,
), ),

Loading…
Cancel
Save