Parking QR implemented

pull/332/head
haroon amjad 4 weeks ago
parent 8957382689
commit 4eb4d0b37d

@ -1908,5 +1908,7 @@
"amountOnly": "المبلغ", "amountOnly": "المبلغ",
"invoiceHistory": "سجل الفواتير", "invoiceHistory": "سجل الفواتير",
"thisInvoiceIsNotEligibleForRefund": "هذه الفاتورة غير مؤهلة للاسترداد", "thisInvoiceIsNotEligibleForRefund": "هذه الفاتورة غير مؤهلة للاسترداد",
"refund": "استرداد" "refund": "استرداد",
"parkingQR": "رمز الاستجابة السريعة لوقوف السيارات",
"parkingQRDesc": "امسح رمز الاستجابة السريعة (QR Code) أدناه عند بوابة الخروج من موقف السيارات:"
} }

@ -1899,7 +1899,9 @@
"refund": "Refund", "refund": "Refund",
"advanceNumber": "Advance Number", "advanceNumber": "Advance Number",
"amountOnly": "Amount", "amountOnly": "Amount",
"invoiceHistory": "Invoice History" "invoiceHistory": "Invoice History",
"parkingQR": "Parking QR Code",
"parkingQRDesc": "Scan the below QR Code at the exit parking gate:"
} }

@ -4,7 +4,7 @@ import 'package:hmg_patient_app_new/core/enums.dart';
class ApiConsts { class ApiConsts {
static const maxSmallScreen = 660; static const maxSmallScreen = 660;
static AppEnvironmentTypeEnum appEnvironmentType = AppEnvironmentTypeEnum.prod; static AppEnvironmentTypeEnum appEnvironmentType = AppEnvironmentTypeEnum.uat;
// static String baseUrl = 'https://uat.hmgwebservices.com/'; // HIS API URL UAT // static String baseUrl = 'https://uat.hmgwebservices.com/'; // HIS API URL UAT

@ -49,8 +49,8 @@ class AppState {
bool isPaytabsEnabled = false; bool isPaytabsEnabled = false;
void setIsPaytabsEnabled(bool value) { void setIsPaytabsEnabled(bool value) {
isPaytabsEnabled = value; // isPaytabsEnabled = value;
// isPaytabsEnabled = false; isPaytabsEnabled = false;
} }
int? _superUserID; int? _superUserID;

@ -26,6 +26,7 @@ import 'package:hmg_patient_app_new/features/authentication/models/resp_models/a
import 'package:hmg_patient_app_new/features/authentication/models/resp_models/check_activation_code_resp_model.dart'; import 'package:hmg_patient_app_new/features/authentication/models/resp_models/check_activation_code_resp_model.dart';
import 'package:hmg_patient_app_new/features/authentication/models/resp_models/check_user_staus_nhic_response_model.dart'; import 'package:hmg_patient_app_new/features/authentication/models/resp_models/check_user_staus_nhic_response_model.dart';
import 'package:hmg_patient_app_new/features/authentication/models/resp_models/select_device_by_imei.dart'; import 'package:hmg_patient_app_new/features/authentication/models/resp_models/select_device_by_imei.dart';
import 'package:hmg_patient_app_new/features/habib_wallet/habib_wallet_view_model.dart';
import 'package:hmg_patient_app_new/features/hmg_services/hmg_services_view_model.dart'; import 'package:hmg_patient_app_new/features/hmg_services/hmg_services_view_model.dart';
import 'package:hmg_patient_app_new/features/medical_file/medical_file_view_model.dart'; import 'package:hmg_patient_app_new/features/medical_file/medical_file_view_model.dart';
import 'package:hmg_patient_app_new/features/my_appointments/my_appointments_view_model.dart'; import 'package:hmg_patient_app_new/features/my_appointments/my_appointments_view_model.dart';
@ -1252,6 +1253,7 @@ class AuthenticationViewModel extends ChangeNotifier {
} }
await clearDefaultInputValues(); await clearDefaultInputValues();
myAppointmentsVM.setIsAppointmentDataToBeLoaded(true); myAppointmentsVM.setIsAppointmentDataToBeLoaded(true);
getIt.get<HabibWalletViewModel>().setIsWalletAmountToBeLoaded(true);
getIt.get<InsuranceViewModel>().setIsInsuranceDataToBeLoaded(true); getIt.get<InsuranceViewModel>().setIsInsuranceDataToBeLoaded(true);
getIt.get<HmgServicesViewModel>().setHasVitalSignDataLoaded(false); getIt.get<HmgServicesViewModel>().setHasVitalSignDataLoaded(false);
if (isUserAgreedBefore) { if (isUserAgreedBefore) {

@ -347,7 +347,7 @@ class EmergencyServicesViewModel extends ChangeNotifier {
(failure) { (failure) {
patientHasAdvanceERBalance = false; patientHasAdvanceERBalance = false;
isERBookAppointment = true; isERBookAppointment = true;
isAdvanceERBalanceNeedToBeLoaded = true; isAdvanceERBalanceNeedToBeLoaded = false;
if (onSuccess != null) { if (onSuccess != null) {
onSuccess(failure.message); onSuccess(failure.message);
} }
@ -357,7 +357,7 @@ class EmergencyServicesViewModel extends ChangeNotifier {
// dialogService.showErrorDialog(message: apiResponse.errorMessage!, onOkPressed: () {}); // dialogService.showErrorDialog(message: apiResponse.errorMessage!, onOkPressed: () {});
patientHasAdvanceERBalance = false; patientHasAdvanceERBalance = false;
isERBookAppointment = true; isERBookAppointment = true;
isAdvanceERBalanceNeedToBeLoaded = true; isAdvanceERBalanceNeedToBeLoaded = false;
} else if (apiResponse.messageStatus == 1) { } else if (apiResponse.messageStatus == 1) {
patientHasAdvanceERBalance = apiResponse.data; patientHasAdvanceERBalance = apiResponse.data;
isERBookAppointment = !patientHasAdvanceERBalance; isERBookAppointment = !patientHasAdvanceERBalance;

@ -551,7 +551,12 @@ class HabibWalletViewModel extends ChangeNotifier {
final result = await habibWalletRepo.getLakumAccountInformation(identificationNumber: getIt.get<AppState>().getAuthenticatedUser()!.patientIdentificationNo ?? ""); final result = await habibWalletRepo.getLakumAccountInformation(identificationNumber: getIt.get<AppState>().getAuthenticatedUser()!.patientIdentificationNo ?? "");
result.fold( result.fold(
(failure) async => await errorHandlerService.handleError(failure: failure), // (failure) async => await errorHandlerService.handleError(failure: failure),
(failure) async {
yahalaAccountNumber = "0";
isLakumAccountInfoLoading = false;
notifyListeners(); // 675534
},
(apiResponse) async { (apiResponse) async {
if (apiResponse.messageStatus == 2) { if (apiResponse.messageStatus == 2) {
yahalaAccountNumber = "0"; yahalaAccountNumber = "0";

@ -54,7 +54,8 @@ class AppointmentParkingQRResponseModel {
isUsed = json['IsUsed']; isUsed = json['IsUsed'];
patientID = json['PatientID']; patientID = json['PatientID'];
projectID = json['ProjectID']; projectID = json['ProjectID'];
ticketBase64 = json['TicketBase64'].cast<int>(); // ticketBase64 = json['TicketBase64'].cast<int>();
ticketBase64 = json['TicketBase64String'];
ticketID = json['TicketID']; ticketID = json['TicketID'];
ticketURL = json['TicketURL']; ticketURL = json['TicketURL'];
} }

@ -1,3 +1,6 @@
import 'dart:convert';
import 'dart:typed_data';
import 'package:easy_localization/easy_localization.dart'; import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:get_it/get_it.dart'; import 'package:get_it/get_it.dart';
@ -103,6 +106,8 @@ class MyAppointmentsViewModel extends ChangeNotifier {
AppointmentParkingQRResponseModel? appointmentParkingQRResponseModel; AppointmentParkingQRResponseModel? appointmentParkingQRResponseModel;
Uint8List? parkingQRImageBytes;
MyAppointmentsViewModel({required this.myAppointmentsRepo, required this.errorHandlerService, required this.appState}); MyAppointmentsViewModel({required this.myAppointmentsRepo, required this.errorHandlerService, required this.appState});
void onTabChange(int index) { void onTabChange(int index) {
@ -736,6 +741,9 @@ class MyAppointmentsViewModel extends ChangeNotifier {
}, },
(apiResponse) { (apiResponse) {
appointmentParkingQRResponseModel = apiResponse.data!; appointmentParkingQRResponseModel = apiResponse.data!;
parkingQRImageBytes = base64Decode(
appointmentParkingQRResponseModel!.ticketBase64.contains(',') ? appointmentParkingQRResponseModel!.ticketBase64.split(',').last : appointmentParkingQRResponseModel!.ticketBase64);
// parkingQRImageBytes = appointmentParkingQRResponseModel!.ticketBase64;
notifyListeners(); notifyListeners();
if (onSuccess != null) { if (onSuccess != null) {
onSuccess(apiResponse); onSuccess(apiResponse);

@ -1894,5 +1894,7 @@ abstract class LocaleKeys {
static const invoiceHistory = 'invoiceHistory'; static const invoiceHistory = 'invoiceHistory';
static const thisInvoiceIsNotEligibleForRefund = 'thisInvoiceIsNotEligibleForRefund'; static const thisInvoiceIsNotEligibleForRefund = 'thisInvoiceIsNotEligibleForRefund';
static const refund = 'refund'; static const refund = 'refund';
static const parkingQR = 'parkingQR';
static const parkingQRDesc = 'parkingQRDesc';
} }

@ -874,35 +874,76 @@ class _AppointmentDetailsPageState extends State<AppointmentDetailsPage> {
} }
}) })
: SizedBox.shrink(), : SizedBox.shrink(),
// (widget.patientAppointmentHistoryResponseModel.isParkingAvailable ?? false) (widget.patientAppointmentHistoryResponseModel.isParkingAvailable ?? false)
// ? MedicalFileCard( ? MedicalFileCard(
// label: LocaleKeys.getParkingQR.tr(context: context), label: LocaleKeys.getParkingQR.tr(context: context),
// textColor: AppColors.blackColor, textColor: AppColors.blackColor,
// backgroundColor: AppColors.whiteColor, backgroundColor: AppColors.whiteColor,
// svgIcon: AppAssets.appointment_parking_icon, svgIcon: AppAssets.appointment_parking_icon,
// isLargeText: true, isLargeText: true,
// iconSize: 36.w, iconSize: 36.w,
// ).onPress(() { ).onPress(() {
// LoaderBottomSheet.showLoader(loadingText: LocaleKeys.loadingText.tr(context: context)); LoaderBottomSheet.showLoader(loadingText: LocaleKeys.loadingText.tr(context: context));
// myAppointmentsViewModel.getParkingQR( myAppointmentsViewModel.getParkingQR(
// widget.patientAppointmentHistoryResponseModel.appointmentNo, widget.patientAppointmentHistoryResponseModel.appointmentNo,
// widget.patientAppointmentHistoryResponseModel.projectID, widget.patientAppointmentHistoryResponseModel.projectID,
// onSuccess: (val) { onSuccess: (val) {
// LoaderBottomSheet.hideLoader(); LoaderBottomSheet.hideLoader();
// }, showCommonBottomSheetWithoutHeight(
// onError: (err) { title: LocaleKeys.parkingQR.tr(context: context),
// LoaderBottomSheet.hideLoader(); context,
// showCommonBottomSheetWithoutHeight( child: SizedBox(
// context, // height: 150.h,
// child: Utils.getErrorWidget(loadingText: err), child: Column(
// callBackFunc: () {}, children: [
// isFullScreen: false, LocaleKeys.parkingQRDesc.tr(context: context).toText16(),
// isCloseButtonVisible: true, SizedBox(height: 16.h),
// ); Image.memory(
// }, myAppointmentsViewModel.parkingQRImageBytes!,
// ); width: 156.w,
// }) height: 156.h,
// : SizedBox.shrink(), fit: BoxFit.cover,
gaplessPlayback: true, // Prevents blink during image rebuild
),
SizedBox(height: 16.h),
CustomButton(
text: LocaleKeys.done.tr(context: context),
onPressed: () {
openDoctorScheduleCalendar();
},
backgroundColor: AppColors.primaryRedColor,
borderColor: AppColors.primaryRedColor,
textColor: Colors.white,
fontSize: 16.f,
fontWeight: FontWeight.w600,
borderRadius: 12.r,
padding: EdgeInsets.symmetric(horizontal: 10.w),
height: 50.h,
icon: AppAssets.checkmark_icon,
iconColor: Colors.white,
iconSize: 18.h,
).paddingSymmetrical(0.h, 0.h),
],
),
),
callBackFunc: () {},
isFullScreen: false,
isCloseButtonVisible: true,
);
},
onError: (err) {
LoaderBottomSheet.hideLoader();
showCommonBottomSheetWithoutHeight(
context,
child: Utils.getErrorWidget(loadingText: err),
callBackFunc: () {},
isFullScreen: false,
isCloseButtonVisible: true,
);
},
);
})
: SizedBox.shrink(),
], ],
); );
}), }),

@ -2,8 +2,8 @@ name: hmg_patient_app_new
description: "New HMG Patient App" description: "New HMG Patient App"
publish_to: 'none' # Remove this line if you wish to publish to pub.dev publish_to: 'none' # Remove this line if you wish to publish to pub.dev
#version: 0.0.32+31 version: 0.0.35+34
version: 0.0.5+2 #version: 0.0.6+3
environment: environment:
sdk: ">=3.6.0 <4.0.0" sdk: ">=3.6.0 <4.0.0"

Loading…
Cancel
Save