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

Reviewed-on: https://34.17.182.140/Haroon6138/HMG_Patient_App_New/pulls/342
pull/344/head
Haroon6138 3 weeks ago
commit 765137ce3e

@ -213,6 +213,8 @@ class ApiClientImp implements ApiClient {
// body['TokenID'] = "@dm!n";
// body['PatientID'] = 1018977;
// body['PatientID'] = 89754444;
// body['PatientID'] = 53320;
// body['PatientID'] = 4769748;
// body['PatientTypeID'] = 1;
// body['PatientOutSA'] = 0;
// body['SessionID'] = "45786230487560q";

@ -5,7 +5,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
@ -301,7 +301,7 @@ class ApiConsts {
static String googleCloudStorageENTranslationFileBaseURL = "https://storage.googleapis.com/hmg-patientapp-translations";
// ************ static values for Api ****************
static final double appVersionID = 21.4;
static final double appVersionID = 21.5;
// static final double appVersionID = 50.7;
static final int appChannelId = 3;

@ -18,7 +18,8 @@ class DateUtil {
final endIndex = date.indexOf(end, startIndex + start.length);
return DateTime.fromMillisecondsSinceEpoch(int.parse(
date.substring(startIndex + start.length, endIndex),
), isUtc: true).add(Duration(hours: 3));
// ), isUtc: true).add(Duration(hours: 3));
), isUtc: true).toLocal();
}
static DateTime convertStringToDateSaudiTimezone(String date, int projectId) {

@ -42,7 +42,7 @@ class MedicalFileViewModel extends ChangeNotifier {
bool isSickLeavesSortByClinic = true;
// bool isSickLeavesDataNeedsReloading = true;
bool isSickLeavesDataNeedsReloading = true;
List<GetAllergiesResponseModel> patientAllergiesList = [];
@ -165,15 +165,15 @@ class MedicalFileViewModel extends ChangeNotifier {
}
setIsPatientSickLeaveListLoading(bool val) {
// if (val && isSickLeavesDataNeedsReloading) {
patientSickLeaveList.clear();
patientSickLeavesByClinic.clear();
if (val && isSickLeavesDataNeedsReloading) {
patientSickLeaveList.clear();
patientSickLeavesByClinic.clear();
patientSickLeavesByHospital.clear();
patientSickLeavesViewList.clear();
patientSickLeavePDFBase64 = "";
isSickLeavesSortByClinic = true;
isPatientSickLeaveListLoading = val;
// }
}
notifyListeners();
}
@ -282,9 +282,9 @@ class MedicalFileViewModel extends ChangeNotifier {
}
Future<void> getPatientSickLeaveList({Function(dynamic)? onSuccess, Function(String)? onError}) async {
// if (!isSickLeavesDataNeedsReloading) {
// return;
// }
if (!isSickLeavesDataNeedsReloading) {
return;
}
patientSickLeaveList.clear();
notifyListeners();
@ -300,6 +300,7 @@ class MedicalFileViewModel extends ChangeNotifier {
// ),
(failure) async {
isPatientSickLeaveListLoading = false;
isSickLeavesDataNeedsReloading = true;
notifyListeners();
},
(apiResponse) {
@ -330,7 +331,7 @@ class MedicalFileViewModel extends ChangeNotifier {
}
}
patientSickLeavesViewList = patientSickLeavesByClinic;
// isSickLeavesDataNeedsReloading = false;
isSickLeavesDataNeedsReloading = false;
notifyListeners();
if (onSuccess != null) {

@ -54,6 +54,7 @@ class MyAppointmentsViewModel extends ChangeNotifier {
bool isFavouriteDoctorsDataFetched = false;
bool isAppointmentDataToBeLoaded = true;
bool isMyDoctorsDataToBeLoaded = true;
bool isEyeMeasurementsAppointmentsLoading = false;
@ -213,6 +214,7 @@ class MyAppointmentsViewModel extends ChangeNotifier {
setIsAppointmentDataToBeLoaded(bool val) {
if (val) {
isMyAppointmentsLoading = true;
isMyDoctorsDataToBeLoaded = true;
}
isAppointmentDataToBeLoaded = val;
notifyListeners();
@ -674,7 +676,7 @@ class MyAppointmentsViewModel extends ChangeNotifier {
}
Future<void> getPatientMyDoctors({Function(dynamic)? onSuccess, Function(String)? onError}) async {
// if (!isAppointmentDataToBeLoaded) return;
if (!isMyDoctorsDataToBeLoaded) return;
isPatientMyDoctorsLoading = true;
patientMyDoctorsList.clear();
notifyListeners();
@ -692,6 +694,7 @@ class MyAppointmentsViewModel extends ChangeNotifier {
} else if (apiResponse.messageStatus == 1) {
patientMyDoctorsList = apiResponse.data!;
isPatientMyDoctorsLoading = false;
isMyDoctorsDataToBeLoaded = false;
notifyListeners();
if (onSuccess != null) {
onSuccess(apiResponse);

@ -64,7 +64,7 @@ class PrescriptionsViewModel extends ChangeNotifier {
PrescriptionsViewModel({required this.prescriptionsRepo, required this.errorHandlerService, required this.navServices});
initPrescriptionsViewModel() {
// if (isPrescriptionsDataNeedsReloading) {
if (isPrescriptionsDataNeedsReloading) {
patientPrescriptionOrders.clear();
patientPrescriptionOrdersByClinic.clear();
patientPrescriptionOrdersByHospital.clear();
@ -72,7 +72,7 @@ class PrescriptionsViewModel extends ChangeNotifier {
prescriptionsOrderList.clear();
isPrescriptionsOrdersLoading = true;
getPatientPrescriptionOrders();
// }
}
isSortByClinic = true;
isPrescriptionsDeliveryOrdersLoading = true;
notifyListeners();
@ -138,9 +138,9 @@ class PrescriptionsViewModel extends ChangeNotifier {
}
Future<void> getPatientPrescriptionOrders({Function(dynamic)? onSuccess, Function(String)? onError}) async {
// if (!isPrescriptionsDataNeedsReloading) {
// return;
// }
if (!isPrescriptionsDataNeedsReloading) {
return;
}
final result = await prescriptionsRepo.getPatientPrescriptionOrders(patientId: "1231755");

@ -63,6 +63,7 @@ import 'core/utils/size_utils.dart';
import 'features/monthly_reports/terms_conditions_view_model.dart';
import 'firebase_options.dart';
@pragma('vm:entry-point')
Future<void> _firebaseMessagingBackgroundHandler(RemoteMessage message) async {
await Firebase.initializeApp(options: DefaultFirebaseOptions.currentPlatform);
@ -109,11 +110,6 @@ Future<void> callInitializations() async {
WidgetsFlutterBinding.ensureInitialized();
await EasyLocalization.ensureInitialized();
// Download the latest JSONs from your server
// await TranslationService.downloadTranslations();
// await Firebase.initializeApp(options: DefaultFirebaseOptions.currentPlatform);
try {
// Attempt to get the default app. If it exists, this avoids the error.
await Firebase.app();

@ -277,7 +277,7 @@ class _AppointmentCardState extends State<AppointmentCard> {
(widget.isLoading ? 'Dr' : "${widget.patientAppointmentHistoryResponseModel.doctorTitle}").toText16(isBold: true, maxlines: 1),
Expanded(
child: (widget.isLoading ? 'John Doe' : " ${widget.patientAppointmentHistoryResponseModel.doctorNameObj!.truncate(30)}").toText16(
isBold: true, maxlines: 2, textOverflow: TextOverflow.ellipsis, isEnglishOnly: !Utils.isArabicText(widget.patientAppointmentHistoryResponseModel.doctorNameObj ?? "John Doe")),
isBold: true, maxlines: 1, textOverflow: TextOverflow.ellipsis, isEnglishOnly: !Utils.isArabicText(widget.patientAppointmentHistoryResponseModel.doctorNameObj ?? "John Doe")),
),
SizedBox(width: 12.w),
(widget.patientAppointmentHistoryResponseModel.doctorNationalityFlagURL != null &&

@ -1099,7 +1099,7 @@ class _MedicalFilePageState extends State<MedicalFilePage> {
itemBuilder: (context, index) {
return AnimationConfiguration.staggeredList(
position: index,
duration: const Duration(milliseconds: 1000),
duration: const Duration(milliseconds: 250),
child: SlideAnimation(
horizontalOffset: 100.0,
child: FadeInAnimation(

@ -92,7 +92,7 @@ class MedicalReportCard extends StatelessWidget {
// fontWeight: FontWeight.w600,
isBold: true,
borderRadius: 12.r,
height: 48.h,
height: 40.h,
).toShimmer2(isShow: isLoading),
],
),

@ -242,7 +242,7 @@ class _MedicalReportsPageState extends State<MedicalReportsPage> {
mainAxisSize: MainAxisSize.min,
children: [
Utils.buildImgWithNetwork(
url: report.doctorImageURL!,
url: report.doctorImageURL ?? "",
iconColor: AppColors.transparent,
width: 24.h,
height: 24.h,

Loading…
Cancel
Save