Parking QR implemented

haroon_dev
haroon amjad 1 week ago
parent 8957382689
commit 4eb4d0b37d

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

@ -1899,7 +1899,9 @@
"refund": "Refund",
"advanceNumber": "Advance Number",
"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 {
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

@ -49,8 +49,8 @@ class AppState {
bool isPaytabsEnabled = false;
void setIsPaytabsEnabled(bool value) {
isPaytabsEnabled = value;
// isPaytabsEnabled = false;
// isPaytabsEnabled = value;
isPaytabsEnabled = false;
}
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_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/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/medical_file/medical_file_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();
myAppointmentsVM.setIsAppointmentDataToBeLoaded(true);
getIt.get<HabibWalletViewModel>().setIsWalletAmountToBeLoaded(true);
getIt.get<InsuranceViewModel>().setIsInsuranceDataToBeLoaded(true);
getIt.get<HmgServicesViewModel>().setHasVitalSignDataLoaded(false);
if (isUserAgreedBefore) {

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

@ -551,7 +551,12 @@ class HabibWalletViewModel extends ChangeNotifier {
final result = await habibWalletRepo.getLakumAccountInformation(identificationNumber: getIt.get<AppState>().getAuthenticatedUser()!.patientIdentificationNo ?? "");
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 {
if (apiResponse.messageStatus == 2) {
yahalaAccountNumber = "0";

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

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

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

@ -874,35 +874,76 @@ class _AppointmentDetailsPageState extends State<AppointmentDetailsPage> {
}
})
: SizedBox.shrink(),
// (widget.patientAppointmentHistoryResponseModel.isParkingAvailable ?? false)
// ? MedicalFileCard(
// label: LocaleKeys.getParkingQR.tr(context: context),
// textColor: AppColors.blackColor,
// backgroundColor: AppColors.whiteColor,
// svgIcon: AppAssets.appointment_parking_icon,
// isLargeText: true,
// iconSize: 36.w,
// ).onPress(() {
// LoaderBottomSheet.showLoader(loadingText: LocaleKeys.loadingText.tr(context: context));
// myAppointmentsViewModel.getParkingQR(
// widget.patientAppointmentHistoryResponseModel.appointmentNo,
// widget.patientAppointmentHistoryResponseModel.projectID,
// onSuccess: (val) {
// LoaderBottomSheet.hideLoader();
// },
// onError: (err) {
// LoaderBottomSheet.hideLoader();
// showCommonBottomSheetWithoutHeight(
// context,
// child: Utils.getErrorWidget(loadingText: err),
// callBackFunc: () {},
// isFullScreen: false,
// isCloseButtonVisible: true,
// );
// },
// );
// })
// : SizedBox.shrink(),
(widget.patientAppointmentHistoryResponseModel.isParkingAvailable ?? false)
? MedicalFileCard(
label: LocaleKeys.getParkingQR.tr(context: context),
textColor: AppColors.blackColor,
backgroundColor: AppColors.whiteColor,
svgIcon: AppAssets.appointment_parking_icon,
isLargeText: true,
iconSize: 36.w,
).onPress(() {
LoaderBottomSheet.showLoader(loadingText: LocaleKeys.loadingText.tr(context: context));
myAppointmentsViewModel.getParkingQR(
widget.patientAppointmentHistoryResponseModel.appointmentNo,
widget.patientAppointmentHistoryResponseModel.projectID,
onSuccess: (val) {
LoaderBottomSheet.hideLoader();
showCommonBottomSheetWithoutHeight(
title: LocaleKeys.parkingQR.tr(context: context),
context,
child: SizedBox(
// height: 150.h,
child: Column(
children: [
LocaleKeys.parkingQRDesc.tr(context: context).toText16(),
SizedBox(height: 16.h),
Image.memory(
myAppointmentsViewModel.parkingQRImageBytes!,
width: 156.w,
height: 156.h,
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"
publish_to: 'none' # Remove this line if you wish to publish to pub.dev
#version: 0.0.32+31
version: 0.0.5+2
version: 0.0.35+34
#version: 0.0.6+3
environment:
sdk: ">=3.6.0 <4.0.0"

Loading…
Cancel
Save