Merge pull request 'haroon_dev' (#309) from haroon_dev into master

Reviewed-on: https://34.17.182.140/Haroon6138/HMG_Patient_App_New/pulls/309
dev_aamir
Haroon6138 23 hours ago
commit 7e06d8e653

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

@ -494,7 +494,7 @@ class PushNotificationHandler {
log("Push Notification getToken: ${token!}");
onToken(token!);
}).catchError((err) {
log(err);
log(err.toString());
});
FirebaseMessaging.instance.onTokenRefresh.listen((fcm_token) {

@ -284,10 +284,14 @@ class AuthenticationViewModel extends ChangeNotifier {
// Validate based on selected country
if (selectedCountrySignup == CountryEnum.saudiArabia) {
if (!ValidationUtils.validateIqama(nationalIdController.text)) {
_nationalIdError = LocaleKeys.pleaseEnterAValidIqamaID.tr();
notifyListeners();
return false;
if (cleanedId.length == 10) {
if (!ValidationUtils.validateIqama(nationalIdController.text)) {
_nationalIdError = LocaleKeys.pleaseEnterAValidIqamaID.tr();
notifyListeners();
return false;
}
} else {
return true;
}
} else if (selectedCountrySignup == CountryEnum.unitedArabEmirates) {
if (!ValidationUtils.validateUaeNationalId(nationalIdController.text)) {

@ -1106,7 +1106,7 @@ class BookAppointmentsViewModel extends ChangeNotifier {
docID: selectedDoctor.doctorID!,
clinicID: selectedDoctor.clinicID!,
projectID: selectedDoctor.projectID!,
serviceID: selectedLiveCareClinic.serviceID!,
serviceID: selectedLiveCareClinic.serviceID ?? 0,
selectedDate: selectedAppointmentDate,
selectedTime: selectedAppointmentTime,
initialSlotDuration: initialSlotDuration,

@ -96,7 +96,13 @@ Future<void> callAppStateInitializations() async {
// Pass all uncaught asynchronous errors that aren't handled by the Flutter framework to Crashlytics
PlatformDispatcher.instance.onError = (error, stack) {
if (!kDebugMode) FirebaseCrashlytics.instance.recordError(error, stack, fatal: true);
if (!kDebugMode) {
FirebaseCrashlytics.instance.recordError(error, stack,
fatal: true,
printDetails: true,
reason:
"${appState.isAuthenticated ? "Authenticated User ID: ${appState.getAuthenticatedUser()!.patientId} - ${appState.getAuthenticatedUser()!.mobileNumber}" : "Unauthenticated User"} - Uncaught asynchronous error");
}
return true;
};
}

@ -78,7 +78,7 @@ class _DoctorResponsePageState extends State<DoctorResponsePage> {
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
askDoctorVM.doctorResponsesList[index].requestTypeDescription!.toText18(isBold: true),
(askDoctorVM.doctorResponsesList[index].requestTypeDescription ?? "").toText18(isBold: true),
SizedBox(height: 24.h),
Row(
crossAxisAlignment: CrossAxisAlignment.start,

@ -451,7 +451,7 @@ class _LandingPageState extends State<LandingPage> {
height: isTablet ? 290.h : 255.h,
child: ListView.separated(
scrollDirection: Axis.horizontal,
itemCount: 3,
itemCount: myAppointmentsVM.patientAppointmentsHistoryList.length < 3 ? myAppointmentsVM.patientAppointmentsHistoryList.length : 3,
shrinkWrap: true,
padding: EdgeInsets.only(left: 16.h, right: 16.h),
itemBuilder: (context, index) {
@ -980,9 +980,14 @@ class _LandingPageState extends State<LandingPage> {
// );
// }
return _buildAppointmentCardWrapper(
myAppointmentsViewModel.patientAppointmentsHistoryList[1],
);
// Safety check: ensure list has at least 2 items
if (myAppointmentsViewModel.patientAppointmentsHistoryList.length > 1) {
return _buildAppointmentCardWrapper(
myAppointmentsViewModel.patientAppointmentsHistoryList[1],
);
}
return Container(); // Return empty container if not enough items
}
// Third slot: Shows ancillary orders or appointment
@ -996,9 +1001,14 @@ class _LandingPageState extends State<LandingPage> {
// );
}
return _buildAppointmentCardWrapper(
myAppointmentsViewModel.patientAppointmentsHistoryList[2],
);
// Safety check: ensure list has at least 3 items
if (myAppointmentsViewModel.patientAppointmentsHistoryList.length > 2) {
return _buildAppointmentCardWrapper(
myAppointmentsViewModel.patientAppointmentsHistoryList[2],
);
}
return Container(); // Return empty container if not enough items
}
// Queue Card Widget

@ -186,7 +186,7 @@ class InsuranceApprovalDetailsPage extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
"${LocaleKeys.status.tr(context: context)}: ".toText14(isBold: true),
insuranceApprovalResponseModel.apporvalDetails![index]!.status!.toText12(isBold: true, color: AppColors.greyTextColor),
(insuranceApprovalResponseModel.apporvalDetails![index].status ?? "").toText12(isBold: true, color: AppColors.greyTextColor),
],
),
SizedBox(height: 8.h),
@ -194,7 +194,7 @@ class InsuranceApprovalDetailsPage extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
"${LocaleKeys.usageStatus.tr(context: context)}: ".toText14(isBold: true),
(insuranceApprovalResponseModel.apporvalDetails![index]!.isInvoicedDesc ?? "").toText12(isBold: true, color: AppColors.greyTextColor),
(insuranceApprovalResponseModel.apporvalDetails![index].isInvoicedDesc ?? "").toText12(isBold: true, color: AppColors.greyTextColor),
],
),
],

@ -265,7 +265,7 @@ void showCommonBottomSheetWithoutHeight(
builder: (BuildContext context) {
if (isAutoDismiss) {
Future.delayed(Duration(seconds: 2), () {
Navigator.of(context).pop();
Navigator.of(GetIt.instance<NavigationService>().navigatorKey.currentContext!).pop();
if (callBackFunc != null) {
callBackFunc();
}

Loading…
Cancel
Save