Updates & fixes

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

@ -78,3 +78,11 @@
-keep class com.hiennv.flutter_callkit_incoming.** { *; } -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 # 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. # CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true' ENV['COCOAPODS_DISABLE_STATS'] = 'true'
@ -54,6 +54,7 @@ post_install do |installer|
'PERMISSION_EVENTS_FULL_ACCESS=1', 'PERMISSION_EVENTS_FULL_ACCESS=1',
## dart: PermissionGroup.reminders ## dart: PermissionGroup.reminders
'PERMISSION_REMINDERS=1', 'PERMISSION_REMINDERS=1',
'PERMISSION_PHOTOS=1',
## dart: PermissionGroup.notification ## dart: PermissionGroup.notification
'PERMISSION_NOTIFICATIONS=1', 'PERMISSION_NOTIFICATIONS=1',
] ]

@ -771,6 +771,7 @@ class Utils {
double height = 24, double height = 24,
BoxFit fit = BoxFit.cover, BoxFit fit = BoxFit.cover,
bool applyThemeColor = true, bool applyThemeColor = true,
String? errorAsset,
}) { }) {
final Color? resolvedColor = iconColor ?? (applyThemeColor && AppColors.isDarkMode ? AppColors.textColor : null); final Color? resolvedColor = iconColor ?? (applyThemeColor && AppColors.isDarkMode ? AppColors.textColor : null);
return SvgPicture.asset( return SvgPicture.asset(
@ -779,6 +780,15 @@ class Utils {
width: width, width: width,
height: height, height: height,
fit: fit, 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 { checkLastLoginStatus(Function() onSuccess) async {
Future.delayed(Duration(seconds: 1), () async { Future.delayed(Duration(seconds: 1), () async {
if (cacheService.getBool(key: CacheConst.quickLoginEnabled) == null) { if (cacheService.getBool(key: CacheConst.quickLoginEnabled) == null) {
if (_appState.getSelectDeviceByImeiRespModelElement != null && final deviceElement = _appState.getSelectDeviceByImeiRespModelElement;
(_appState.getSelectDeviceByImeiRespModelElement!.logInType == 1 || _appState.getSelectDeviceByImeiRespModelElement!.logInType == 4)) { if (deviceElement != null && (deviceElement.logInType == 1 || deviceElement.logInType == 4)) {
phoneNumberController.text = (_appState.getAuthenticatedUser()!.mobileNumber!.startsWith("0") phoneNumberController.text = (_appState.getAuthenticatedUser()!.mobileNumber!.startsWith("0")
? _appState.getAuthenticatedUser()!.mobileNumber!.replaceFirst("0", "") ? _appState.getAuthenticatedUser()!.mobileNumber!.replaceFirst("0", "")
: _appState.getAuthenticatedUser()!.mobileNumber)!; : _appState.getAuthenticatedUser()!.mobileNumber)!;
nationalIdController.text = _appState.getAuthenticatedUser()!.patientIdentificationNo!; nationalIdController.text = _appState.getAuthenticatedUser()!.patientIdentificationNo!;
onSuccess(); onSuccess();
} else if ((loginTypeEnum == LoginTypeEnum.sms || loginTypeEnum == LoginTypeEnum.whatsapp && _appState.getSelectDeviceByImeiRespModelElement == null) && } else if ((loginTypeEnum == LoginTypeEnum.sms || loginTypeEnum == LoginTypeEnum.whatsapp && deviceElement == null) && _appState.getAuthenticatedUser() != null) {
_appState.getAuthenticatedUser() != null) {
phoneNumberController.text = (_appState.getAuthenticatedUser()!.mobileNumber!.startsWith("0") phoneNumberController.text = (_appState.getAuthenticatedUser()!.mobileNumber!.startsWith("0")
? _appState.getAuthenticatedUser()!.mobileNumber!.replaceFirst("0", "") ? _appState.getAuthenticatedUser()!.mobileNumber!.replaceFirst("0", "")
: _appState.getAuthenticatedUser()!.mobileNumber)!; : _appState.getAuthenticatedUser()!.mobileNumber)!;

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

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

@ -49,6 +49,7 @@ class ClinicCard extends StatelessWidget {
width: 24.w, width: 24.w,
height: 24.h, height: 24.h,
fit: BoxFit.contain, fit: BoxFit.contain,
errorAsset: "assets/images/clinicIcons/1.svg"
// Note: Add error handling in the Utils.buildSvgWithAssets if possible // Note: Add error handling in the Utils.buildSvgWithAssets if possible
// or use a try-catch wrapper // 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/presentation/todo_section/widgets/ancillary_orders_list.dart';
import 'package:hmg_patient_app_new/routes/app_routes.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/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/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/chip/app_custom_chip_widget.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( appointmentRatingViewModel.getLastRatingAppointment(
onSuccess: (response) { onSuccess: (response) {
if (appointmentRatingViewModel.appointmentRatedList.isNotEmpty) { 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.getAppointmentDetails(
appointmentRatingViewModel.appointmentRatedList.last.appointmentNo!, appointmentNo,
appointmentRatingViewModel.appointmentRatedList.last.projectID!, projectID,
onSuccess: ((response) { onSuccess: ((response) {
appointmentRatingViewModel.setClinicOrDoctor(false); appointmentRatingViewModel.setClinicOrDoctor(false);
appointmentRatingViewModel.setTitle(LocaleKeys.rateDoctor.tr(context: context)); appointmentRatingViewModel.setTitle(LocaleKeys.rateDoctor.tr(context: context));
@ -214,23 +219,24 @@ class _LandingPageState extends State<LandingPage> {
immediateLiveCareViewModel.initImmediateLiveCare(); immediateLiveCareViewModel.initImmediateLiveCare();
immediateLiveCareViewModel.getPatientLiveCareHistory(); immediateLiveCareViewModel.getPatientLiveCareHistory();
appointmentRatingViewModel.getLastRatingAppointment( // appointmentRatingViewModel.getLastRatingAppointment(
onSuccess: (response) { // onSuccess: (response) {
if (appointmentRatingViewModel.appointmentRatedList.isNotEmpty) { // if (appointmentRatingViewModel.appointmentRatedList.isNotEmpty) {
appointmentRatingViewModel.getAppointmentDetails( // appointmentRatingViewModel.getAppointmentDetails(
appointmentRatingViewModel.appointmentRatedList.last.appointmentNo!, // appointmentRatingViewModel.appointmentRatedList.last.appointmentNo!,
appointmentRatingViewModel.appointmentRatedList.last.projectID!, // appointmentRatingViewModel.appointmentRatedList.last.projectID!,
onSuccess: ((response) { // onSuccess: ((response) {
appointmentRatingViewModel.setClinicOrDoctor(false); // appointmentRatingViewModel.setClinicOrDoctor(false);
appointmentRatingViewModel.setTitle(LocaleKeys.rateDoctor.tr(context: context)); // appointmentRatingViewModel.setTitle(LocaleKeys.rateDoctor.tr(context: context));
appointmentRatingViewModel.setSubTitle(LocaleKeys.howWasYourLastVisitWithDoctor.tr(context: context)); // appointmentRatingViewModel.setSubTitle(LocaleKeys.howWasYourLastVisitWithDoctor.tr(context: context));
openLastRating(); // openLastRating();
appState.setRatedVisible(true); // appState.setRatedVisible(true);
}), // }),
); // );
} // }
}, // },
); // );
} }
}, },
child: SingleChildScrollView( child: SingleChildScrollView(
@ -1394,7 +1400,7 @@ class _LandingPageState extends State<LandingPage> {
void showQuickLogin(BuildContext context) { void showQuickLogin(BuildContext context) {
showCommonBottomSheetWithoutHeight( showCommonBottomSheetWithoutHeight(
context, getIt<NavigationService>().navigatorKey.currentContext!,
// title: "", // title: "",
isCloseButtonVisible: false, isCloseButtonVisible: false,
child: StatefulBuilder( child: StatefulBuilder(

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

@ -130,9 +130,11 @@ class _UpdateEmergencyContactDialogState extends State<UpdateEmergencyContactDia
onSuccess: (response) { onSuccess: (response) {
LoaderBottomSheet.hideLoader(); LoaderBottomSheet.hideLoader();
profileSettingsViewModel!.clearEmergencyContactError(); 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 { callBackFunc: () async {
Navigator.of(getIt.get<NavigationService>().navigatorKey.currentContext!).pop(); Navigator.of(navContext).pop();
profileSettingsViewModel!.getProfileSettings(); profileSettingsViewModel!.getProfileSettings();
}, isFullScreen: false, isAutoDismiss: true); }, isFullScreen: false, isAutoDismiss: true);
}, },

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

Loading…
Cancel
Save