Updates & fixes

pull/324/head
haroon amjad 1 month ago
parent 8ffd7485d6
commit f08775cbd4

@ -77,4 +77,12 @@
-keep class com.peng.pennavmap.db.** { *; }
-keep class com.hiennv.flutter_callkit_incoming.** { *; }
-keepattributes Signature, Annotation, InnerClasses, EnclosingMethod
-keepattributes Signature, Annotation, InnerClasses, EnclosingMethod
-keep class com.peng.pennavmap.** { *; }
-keep class com.peng.bus.** { *; }
# EventBus subscribers (reflection-based)
-keepclassmembers class * {
@com.peng.bus.PISubscribe <methods>;
}
-keep class com.peng.pennavmap.models.bus.BackButtonEventBusData { *; }

@ -1,5 +1,5 @@
# Uncomment this line to define a global platform for your project
platform :ios, '14.0'
platform :ios, '15.0'
# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
@ -54,6 +54,7 @@ post_install do |installer|
'PERMISSION_EVENTS_FULL_ACCESS=1',
## dart: PermissionGroup.reminders
'PERMISSION_REMINDERS=1',
'PERMISSION_PHOTOS=1',
## dart: PermissionGroup.notification
'PERMISSION_NOTIFICATIONS=1',
]

@ -771,6 +771,7 @@ class Utils {
double height = 24,
BoxFit fit = BoxFit.cover,
bool applyThemeColor = true,
String? errorAsset,
}) {
final Color? resolvedColor = iconColor ?? (applyThemeColor && AppColors.isDarkMode ? AppColors.textColor : null);
return SvgPicture.asset(
@ -779,6 +780,15 @@ class Utils {
width: width,
height: height,
fit: fit,
errorBuilder: errorAsset != null
? (context, error, stackTrace) => SvgPicture.asset(
errorAsset,
colorFilter: resolvedColor != null ? ColorFilter.mode(isDisabled ? resolvedColor.withOpacity(0.5) : resolvedColor, BlendMode.srcIn) : null,
width: width,
height: height,
fit: fit,
)
: null,
);
}

@ -1377,15 +1377,14 @@ class AuthenticationViewModel extends ChangeNotifier {
checkLastLoginStatus(Function() onSuccess) async {
Future.delayed(Duration(seconds: 1), () async {
if (cacheService.getBool(key: CacheConst.quickLoginEnabled) == null) {
if (_appState.getSelectDeviceByImeiRespModelElement != null &&
(_appState.getSelectDeviceByImeiRespModelElement!.logInType == 1 || _appState.getSelectDeviceByImeiRespModelElement!.logInType == 4)) {
final deviceElement = _appState.getSelectDeviceByImeiRespModelElement;
if (deviceElement != null && (deviceElement.logInType == 1 || deviceElement.logInType == 4)) {
phoneNumberController.text = (_appState.getAuthenticatedUser()!.mobileNumber!.startsWith("0")
? _appState.getAuthenticatedUser()!.mobileNumber!.replaceFirst("0", "")
: _appState.getAuthenticatedUser()!.mobileNumber)!;
nationalIdController.text = _appState.getAuthenticatedUser()!.patientIdentificationNo!;
onSuccess();
} else if ((loginTypeEnum == LoginTypeEnum.sms || loginTypeEnum == LoginTypeEnum.whatsapp && _appState.getSelectDeviceByImeiRespModelElement == null) &&
_appState.getAuthenticatedUser() != null) {
} else if ((loginTypeEnum == LoginTypeEnum.sms || loginTypeEnum == LoginTypeEnum.whatsapp && deviceElement == null) && _appState.getAuthenticatedUser() != null) {
phoneNumberController.text = (_appState.getAuthenticatedUser()!.mobileNumber!.startsWith("0")
? _appState.getAuthenticatedUser()!.mobileNumber!.replaceFirst("0", "")
: _appState.getAuthenticatedUser()!.mobileNumber)!;

@ -639,7 +639,9 @@ class _AppointmentCardState extends State<AppointmentCard> {
),
);
} else {
if (!AppointmentType.isArrived(widget.patientAppointmentHistoryResponseModel)) {
if (!AppointmentType.isArrived(widget.patientAppointmentHistoryResponseModel) &&
widget.patientAppointmentHistoryResponseModel.projectID != null &&
widget.patientAppointmentHistoryResponseModel.clinicID != null) {
widget.bookAppointmentsViewModel.getAppointmentNearestGate(
projectID: widget.patientAppointmentHistoryResponseModel.projectID, clinicID: widget.patientAppointmentHistoryResponseModel.clinicID);
}

@ -51,7 +51,7 @@ class _RegisterNew extends State<RegisterNew> {
// Clear errors when leaving register screen
// Use post frame callback to avoid calling notifyListeners during dispose
WidgetsBinding.instance.addPostFrameCallback((_) {
final authVm = context.read<AuthenticationViewModel>();
final authVm = getIt.get<AuthenticationViewModel>();
authVm.clearNationalIdError();
authVm.clearDobError();
authVm.clearPhoneNumberError();

@ -49,6 +49,7 @@ class ClinicCard extends StatelessWidget {
width: 24.w,
height: 24.h,
fit: BoxFit.contain,
errorAsset: "assets/images/clinicIcons/1.svg"
// Note: Add error handling in the Utils.buildSvgWithAssets if possible
// or use a try-catch wrapper
),

@ -59,6 +59,7 @@ import 'package:hmg_patient_app_new/presentation/todo_section/todo_page.dart';
import 'package:hmg_patient_app_new/presentation/todo_section/widgets/ancillary_orders_list.dart';
import 'package:hmg_patient_app_new/routes/app_routes.dart';
import 'package:hmg_patient_app_new/services/cache_service.dart';
import 'package:hmg_patient_app_new/services/navigation_service.dart';
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/chip/app_custom_chip_widget.dart';
@ -156,9 +157,13 @@ class _LandingPageState extends State<LandingPage> {
appointmentRatingViewModel.getLastRatingAppointment(
onSuccess: (response) {
if (appointmentRatingViewModel.appointmentRatedList.isNotEmpty) {
final lastAppointment = appointmentRatingViewModel.appointmentRatedList.last;
final appointmentNo = lastAppointment.appointmentNo;
final projectID = lastAppointment.projectID;
if (appointmentNo == null || projectID == null) return;
appointmentRatingViewModel.getAppointmentDetails(
appointmentRatingViewModel.appointmentRatedList.last.appointmentNo!,
appointmentRatingViewModel.appointmentRatedList.last.projectID!,
appointmentNo,
projectID,
onSuccess: ((response) {
appointmentRatingViewModel.setClinicOrDoctor(false);
appointmentRatingViewModel.setTitle(LocaleKeys.rateDoctor.tr(context: context));
@ -214,23 +219,24 @@ class _LandingPageState extends State<LandingPage> {
immediateLiveCareViewModel.initImmediateLiveCare();
immediateLiveCareViewModel.getPatientLiveCareHistory();
appointmentRatingViewModel.getLastRatingAppointment(
onSuccess: (response) {
if (appointmentRatingViewModel.appointmentRatedList.isNotEmpty) {
appointmentRatingViewModel.getAppointmentDetails(
appointmentRatingViewModel.appointmentRatedList.last.appointmentNo!,
appointmentRatingViewModel.appointmentRatedList.last.projectID!,
onSuccess: ((response) {
appointmentRatingViewModel.setClinicOrDoctor(false);
appointmentRatingViewModel.setTitle(LocaleKeys.rateDoctor.tr(context: context));
appointmentRatingViewModel.setSubTitle(LocaleKeys.howWasYourLastVisitWithDoctor.tr(context: context));
openLastRating();
appState.setRatedVisible(true);
}),
);
}
},
);
// appointmentRatingViewModel.getLastRatingAppointment(
// onSuccess: (response) {
// if (appointmentRatingViewModel.appointmentRatedList.isNotEmpty) {
// appointmentRatingViewModel.getAppointmentDetails(
// appointmentRatingViewModel.appointmentRatedList.last.appointmentNo!,
// appointmentRatingViewModel.appointmentRatedList.last.projectID!,
// onSuccess: ((response) {
// appointmentRatingViewModel.setClinicOrDoctor(false);
// appointmentRatingViewModel.setTitle(LocaleKeys.rateDoctor.tr(context: context));
// appointmentRatingViewModel.setSubTitle(LocaleKeys.howWasYourLastVisitWithDoctor.tr(context: context));
// openLastRating();
// appState.setRatedVisible(true);
// }),
// );
// }
// },
// );
}
},
child: SingleChildScrollView(
@ -1394,7 +1400,7 @@ class _LandingPageState extends State<LandingPage> {
void showQuickLogin(BuildContext context) {
showCommonBottomSheetWithoutHeight(
context,
getIt<NavigationService>().navigatorKey.currentContext!,
// title: "",
isCloseButtonVisible: false,
child: StatefulBuilder(

@ -1,5 +1,6 @@
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:get_it/get_it.dart';
import 'package:hmg_patient_app_new/core/utils/size_utils.dart';
import 'package:hmg_patient_app_new/core/utils/utils.dart';
import 'package:hmg_patient_app_new/extensions/int_extensions.dart';
@ -7,6 +8,7 @@ import 'package:hmg_patient_app_new/extensions/string_extensions.dart';
import 'package:hmg_patient_app_new/extensions/widget_extensions.dart';
import 'package:hmg_patient_app_new/features/profile_settings/profile_settings_view_model.dart';
import 'package:hmg_patient_app_new/generated/locale_keys.g.dart';
import 'package:hmg_patient_app_new/services/navigation_service.dart';
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/common_bottom_sheet.dart';
@ -70,7 +72,7 @@ class _PreferredLanguageWidgetState extends State<PreferredLanguageWidget> {
LoaderBottomSheet.hideLoader();
showCommonBottomSheetWithoutHeight(context, title: LocaleKeys.success.tr(context: context), child: Utils.getSuccessWidget(loadingText: LocaleKeys.success.tr()),
callBackFunc: () async {
Navigator.of(context).pop();
Navigator.of(GetIt.instance<NavigationService>().navigatorKey.currentContext!).pop();
profileSettingsViewModel.getProfileSettings();
}, isFullScreen: false, isAutoDismiss: true);
},

@ -130,9 +130,11 @@ class _UpdateEmergencyContactDialogState extends State<UpdateEmergencyContactDia
onSuccess: (response) {
LoaderBottomSheet.hideLoader();
profileSettingsViewModel!.clearEmergencyContactError();
showCommonBottomSheetWithoutHeight(context, title: LocaleKeys.success.tr(context: context), child: Utils.getSuccessWidget(loadingText: LocaleKeys.success.tr()),
final navContext = getIt.get<NavigationService>().navigatorKey.currentContext;
if (navContext == null) return;
showCommonBottomSheetWithoutHeight(navContext, title: LocaleKeys.success.tr(context: navContext), child: Utils.getSuccessWidget(loadingText: LocaleKeys.success.tr()),
callBackFunc: () async {
Navigator.of(getIt.get<NavigationService>().navigatorKey.currentContext!).pop();
Navigator.of(navContext).pop();
profileSettingsViewModel!.getProfileSettings();
}, isFullScreen: false, isAutoDismiss: true);
},

@ -66,6 +66,7 @@ class _AncillaryOrderDetailsListState extends State<AncillaryOrderDetailsList> {
}
void _autoSelectEligibleProcedures() {
if (!mounted) return;
selectedProcedures.clear();
if (todoSectionViewModel.patientAncillaryOrderProceduresList.isNotEmpty) {
final procedures = todoSectionViewModel.patientAncillaryOrderProceduresList[0].ancillaryOrderProcDetailsList;
@ -77,7 +78,7 @@ class _AncillaryOrderDetailsListState extends State<AncillaryOrderDetailsList> {
}
}
}
setState(() {});
if (mounted) setState(() {});
}
bool _isProcedureDisabled(AncillaryOrderProcDetail procedure) {

Loading…
Cancel
Save