pull/342/head
haroon amjad 3 weeks ago
parent 753968d3fa
commit 9d8744ec17

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

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

@ -18,7 +18,8 @@ class DateUtil {
final endIndex = date.indexOf(end, startIndex + start.length); final endIndex = date.indexOf(end, startIndex + start.length);
return DateTime.fromMillisecondsSinceEpoch(int.parse( return DateTime.fromMillisecondsSinceEpoch(int.parse(
date.substring(startIndex + start.length, endIndex), 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) { static DateTime convertStringToDateSaudiTimezone(String date, int projectId) {

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

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

@ -64,7 +64,7 @@ class PrescriptionsViewModel extends ChangeNotifier {
PrescriptionsViewModel({required this.prescriptionsRepo, required this.errorHandlerService, required this.navServices}); PrescriptionsViewModel({required this.prescriptionsRepo, required this.errorHandlerService, required this.navServices});
initPrescriptionsViewModel() { initPrescriptionsViewModel() {
// if (isPrescriptionsDataNeedsReloading) { if (isPrescriptionsDataNeedsReloading) {
patientPrescriptionOrders.clear(); patientPrescriptionOrders.clear();
patientPrescriptionOrdersByClinic.clear(); patientPrescriptionOrdersByClinic.clear();
patientPrescriptionOrdersByHospital.clear(); patientPrescriptionOrdersByHospital.clear();
@ -72,7 +72,7 @@ class PrescriptionsViewModel extends ChangeNotifier {
prescriptionsOrderList.clear(); prescriptionsOrderList.clear();
isPrescriptionsOrdersLoading = true; isPrescriptionsOrdersLoading = true;
getPatientPrescriptionOrders(); getPatientPrescriptionOrders();
// } }
isSortByClinic = true; isSortByClinic = true;
isPrescriptionsDeliveryOrdersLoading = true; isPrescriptionsDeliveryOrdersLoading = true;
notifyListeners(); notifyListeners();
@ -138,9 +138,9 @@ class PrescriptionsViewModel extends ChangeNotifier {
} }
Future<void> getPatientPrescriptionOrders({Function(dynamic)? onSuccess, Function(String)? onError}) async { Future<void> getPatientPrescriptionOrders({Function(dynamic)? onSuccess, Function(String)? onError}) async {
// if (!isPrescriptionsDataNeedsReloading) { if (!isPrescriptionsDataNeedsReloading) {
// return; return;
// } }
final result = await prescriptionsRepo.getPatientPrescriptionOrders(patientId: "1231755"); 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 'features/monthly_reports/terms_conditions_view_model.dart';
import 'firebase_options.dart'; import 'firebase_options.dart';
@pragma('vm:entry-point') @pragma('vm:entry-point')
Future<void> _firebaseMessagingBackgroundHandler(RemoteMessage message) async { Future<void> _firebaseMessagingBackgroundHandler(RemoteMessage message) async {
await Firebase.initializeApp(options: DefaultFirebaseOptions.currentPlatform); await Firebase.initializeApp(options: DefaultFirebaseOptions.currentPlatform);
@ -109,11 +110,6 @@ Future<void> callInitializations() async {
WidgetsFlutterBinding.ensureInitialized(); WidgetsFlutterBinding.ensureInitialized();
await EasyLocalization.ensureInitialized(); await EasyLocalization.ensureInitialized();
// Download the latest JSONs from your server
// await TranslationService.downloadTranslations();
// await Firebase.initializeApp(options: DefaultFirebaseOptions.currentPlatform);
try { try {
// Attempt to get the default app. If it exists, this avoids the error. // Attempt to get the default app. If it exists, this avoids the error.
await Firebase.app(); await Firebase.app();

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

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

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

Loading…
Cancel
Save