diff --git a/assets/images/svg/Saudi_Riyal_Symbol.svg b/assets/images/svg/Saudi_Riyal_Symbol.svg
new file mode 100644
index 0000000..d57d83a
--- /dev/null
+++ b/assets/images/svg/Saudi_Riyal_Symbol.svg
@@ -0,0 +1,12 @@
+
+
\ No newline at end of file
diff --git a/assets/images/svg/blood_icon.svg b/assets/images/svg/blood_icon.svg
new file mode 100644
index 0000000..c83b20c
--- /dev/null
+++ b/assets/images/svg/blood_icon.svg
@@ -0,0 +1,3 @@
+
diff --git a/assets/images/svg/checkmark_icon.svg b/assets/images/svg/checkmark_icon.svg
new file mode 100644
index 0000000..e514106
--- /dev/null
+++ b/assets/images/svg/checkmark_icon.svg
@@ -0,0 +1,3 @@
+
diff --git a/assets/images/svg/eye_results_icon.svg b/assets/images/svg/eye_results_icon.svg
new file mode 100644
index 0000000..fd9c754
--- /dev/null
+++ b/assets/images/svg/eye_results_icon.svg
@@ -0,0 +1,4 @@
+
diff --git a/assets/images/svg/file_icon.svg b/assets/images/svg/file_icon.svg
new file mode 100644
index 0000000..7bfc655
--- /dev/null
+++ b/assets/images/svg/file_icon.svg
@@ -0,0 +1,3 @@
+
diff --git a/assets/images/svg/habib_logo_background.svg b/assets/images/svg/habib_logo_background.svg
new file mode 100644
index 0000000..597c7b2
--- /dev/null
+++ b/assets/images/svg/habib_logo_background.svg
@@ -0,0 +1,3 @@
+
diff --git a/assets/images/svg/insurance_active_icon.svg b/assets/images/svg/insurance_active_icon.svg
new file mode 100644
index 0000000..33a25bb
--- /dev/null
+++ b/assets/images/svg/insurance_active_icon.svg
@@ -0,0 +1,3 @@
+
diff --git a/assets/images/svg/recharge_icon.svg b/assets/images/svg/recharge_icon.svg
new file mode 100644
index 0000000..a6f26ce
--- /dev/null
+++ b/assets/images/svg/recharge_icon.svg
@@ -0,0 +1,4 @@
+
diff --git a/assets/images/svg/search_icon.svg b/assets/images/svg/search_icon.svg
new file mode 100644
index 0000000..1a64ce5
--- /dev/null
+++ b/assets/images/svg/search_icon.svg
@@ -0,0 +1,3 @@
+
diff --git a/assets/images/svg/show_icon.svg b/assets/images/svg/show_icon.svg
new file mode 100644
index 0000000..541fd55
--- /dev/null
+++ b/assets/images/svg/show_icon.svg
@@ -0,0 +1,4 @@
+
diff --git a/lib/core/api/api_client.dart b/lib/core/api/api_client.dart
index 92a7e6c..d43ca93 100644
--- a/lib/core/api/api_client.dart
+++ b/lib/core/api/api_client.dart
@@ -134,9 +134,7 @@ class ApiClientImp implements ApiClient {
}
if (body.containsKey('isDentalAllowedBackend')) {
- body['isDentalAllowedBackend'] = body.containsKey('isDentalAllowedBackend')
- ? body['isDentalAllowedBackend'] ?? IS_DENTAL_ALLOWED_BACKEND
- : IS_DENTAL_ALLOWED_BACKEND;
+ body['isDentalAllowedBackend'] = body.containsKey('isDentalAllowedBackend') ? body['isDentalAllowedBackend'] ?? IS_DENTAL_ALLOWED_BACKEND : IS_DENTAL_ALLOWED_BACKEND;
}
//Todo: I have converted it to string
@@ -179,7 +177,7 @@ class ApiClientImp implements ApiClient {
// TODO : we will use all these from appState
body['LanguageID'] = body['LanguageID'] ?? "2";
- body['VersionID'] = body['VersionID'] ?? "18.7";
+ body['VersionID'] = body['VersionID'] ?? "50.0";
body['Channel'] = body['Channel'] ?? "3";
body['IPAdress'] = body['IPAdress'] ?? "10.20.10.20";
body['generalid'] = body['generalid'] ?? "Cs2020@2016\$2958";
@@ -191,6 +189,7 @@ class ApiClientImp implements ApiClient {
: await Utils.isGoogleServicesAvailable()
? "2"
: "3");
+ body['TokenID'] = "@dm!n";
body.removeWhere((key, value) => value == null);
log("body: ${json.encode(body)}");
log("uri: ${Uri.parse(url.trim())}");
@@ -225,19 +224,18 @@ class ApiClientImp implements ApiClient {
if (parsed['isSMSSent'] == true) {
onSuccess(parsed, statusCode, messageStatus: parsed['MessageStatus']);
} else if (parsed['MessageStatus'] == 1) {
- onSuccess(parsed, statusCode);
+ onSuccess(parsed, statusCode, messageStatus: parsed['MessageStatus']);
} else if (parsed['Result'] == 'OK') {
- onSuccess(parsed, statusCode);
+ onSuccess(parsed, statusCode, messageStatus: parsed['MessageStatus']);
} else {
- onFailure(parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], statusCode,
- failureType: ServerFailure("Error While Fetching data"));
+ onFailure(parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], statusCode, failureType: ServerFailure("Error While Fetching data"));
logApiEndpointError(endPoint, parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], statusCode);
}
} else if (parsed['MessageStatus'] == 1 || parsed['SMSLoginRequired'] == true) {
- onSuccess(parsed, statusCode);
+ onSuccess(parsed, statusCode, messageStatus: parsed['MessageStatus']);
} else if (parsed['MessageStatus'] == 2 && parsed['IsAuthenticated']) {
if (parsed['SameClinicApptList'] != null) {
- onSuccess(parsed, statusCode);
+ onSuccess(parsed, statusCode, messageStatus: parsed['MessageStatus']);
} else {
if (parsed['message'] == null && parsed['ErrorEndUserMessage'] == null) {
if (parsed['ErrorSearchMsg'] == null) {
@@ -266,7 +264,7 @@ class ApiClientImp implements ApiClient {
}
} else {
if (parsed['SameClinicApptList'] != null) {
- onSuccess(parsed, statusCode);
+ onSuccess(parsed, statusCode, messageStatus: parsed['MessageStatus']);
} else {
if (parsed['message'] != null) {
onFailure(
diff --git a/lib/core/api_consts.dart b/lib/core/api_consts.dart
index 6f82e26..6e1e92a 100644
--- a/lib/core/api_consts.dart
+++ b/lib/core/api_consts.dart
@@ -17,8 +17,8 @@ var PACKAGES_ORDERS = '/api/orders';
var PACKAGES_ORDER_HISTORY = '/api/orders/items';
var PACKAGES_TAMARA_OPT = '/api/orders/paymentoptions/tamara';
// var BASE_URL = 'http://10.50.100.198:2018/';
-var BASE_URL = 'https://uat.hmgwebservices.com/';
-// var BASE_URL = 'https://hmgwebservices.com/';
+// var BASE_URL = 'https://uat.hmgwebservices.com/';
+var BASE_URL = 'https://hmgwebservices.com/';
// var BASE_URL = 'http://10.201.204.103/';
// var BASE_URL = 'https://orash.cloudsolutions.com.sa/';
// var BASE_URL = 'https://vidauat.cloudsolutions.com.sa/';
diff --git a/lib/core/app_assets.dart b/lib/core/app_assets.dart
index 0e7d944..2032f56 100644
--- a/lib/core/app_assets.dart
+++ b/lib/core/app_assets.dart
@@ -59,6 +59,8 @@ class AppAssets {
static const String habib_background_icon = '$svgBasePath/habib_logo_background.svg';
static const String show_icon = '$svgBasePath/show_icon.svg';
static const String recharge_icon = '$svgBasePath/recharge_icon.svg';
+ static const String eye_result_icon = '$svgBasePath/eye_results_icon.svg';
+ static const String search_icon = '$svgBasePath/search_icon.svg';
// PNGS //
static const String hmg_logo = '$pngBasePath/hmg_logo.png';
diff --git a/lib/core/dependencies.dart b/lib/core/dependencies.dart
index 549eeed..dca08fc 100644
--- a/lib/core/dependencies.dart
+++ b/lib/core/dependencies.dart
@@ -6,6 +6,8 @@ import 'package:hmg_patient_app_new/features/authentication/authentication_repo.
import 'package:hmg_patient_app_new/features/authentication/authentication_view_model.dart';
import 'package:hmg_patient_app_new/features/book_appointments/book_appointments_repo.dart';
import 'package:hmg_patient_app_new/features/common/common_repo.dart';
+import 'package:hmg_patient_app_new/features/lab/lab_repo.dart';
+import 'package:hmg_patient_app_new/features/lab/lab_view_model.dart';
import 'package:hmg_patient_app_new/features/my_appointments/my_appointments_repo.dart';
import 'package:hmg_patient_app_new/services/analytics/analytics_service.dart';
import 'package:hmg_patient_app_new/services/cache_service.dart';
@@ -54,12 +56,20 @@ class AppDependencies {
// Repositories
getIt.registerLazySingleton(() => CommonRepoImp(loggerService: getIt()));
getIt.registerLazySingleton(() => AuthenticationRepoImp(loggerService: getIt(), apiClient: getIt()));
- getIt.registerLazySingleton(
- () => BookAppointmentsRepoImp(loggerService: getIt(), apiClient: getIt()));
+ getIt.registerLazySingleton(() => BookAppointmentsRepoImp(loggerService: getIt(), apiClient: getIt()));
getIt.registerLazySingleton(() => MyAppointmentsRepoImp(loggerService: getIt(), apiClient: getIt()));
+ getIt.registerLazySingleton(() => LabRepoImp(loggerService: getIt(), apiClient: getIt()));
// ViewModels
// Global/shared VMs → LazySingleton
+
+ getIt.registerLazySingleton(
+ () => LabViewModel(
+ labRepo: getIt(),
+ errorHandlerService: getIt(),
+ ),
+ );
+
getIt.registerLazySingleton(
() => AuthenticationViewModel(
authenticationRepo: getIt(),
diff --git a/lib/extensions/widget_extensions.dart b/lib/extensions/widget_extensions.dart
index e6913d2..d1a3db4 100644
--- a/lib/extensions/widget_extensions.dart
+++ b/lib/extensions/widget_extensions.dart
@@ -78,7 +78,14 @@ extension WidgetExtensions on Widget {
}
Widget objectContainerBorderView(
- {String title = "", String note = "", bool disablePadding = false, double radius = 20, Color? color, Color borderColor = AppColors.buttonColor, bool disableWidth = false, bool isAlignment = false}) {
+ {String title = "",
+ String note = "",
+ bool disablePadding = false,
+ double radius = 20,
+ Color? color,
+ Color borderColor = AppColors.buttonColor,
+ bool disableWidth = false,
+ bool isAlignment = false}) {
return Container(
padding: disablePadding ? EdgeInsets.zero : const EdgeInsets.only(top: 15, bottom: 15, left: 14, right: 14),
decoration: BoxDecoration(
@@ -127,6 +134,7 @@ extension SmoothContainerExtension on ShapeBorder {
bool isDisabled = false,
Color? backgroundColor,
BorderSide? side,
+ bool hasShadow = false,
}) {
final bgColor = backgroundColor ?? color;
return ShapeDecoration(
@@ -136,15 +144,19 @@ extension SmoothContainerExtension on ShapeBorder {
smoothness: 1,
side: side ?? BorderSide.none,
),
+ shadows: hasShadow
+ ? [
+ BoxShadow(
+ color: const Color(0xff000000).withOpacity(.05),
+ blurRadius: 32,
+ offset: const Offset(0, 0),
+ )
+ ]
+ : [],
);
}
}
-
-
-
-
-
//Height Spacers in percentages
Widget heightSpacer02per() => SizedBox(height: 0.2.h);
@@ -191,8 +203,6 @@ Widget widthSpacer4per() => SizedBox(height: 4.w);
Widget widthSpacer5per() => SizedBox(height: 5.w);
-
-
extension ChipTypeEnumExtension on ChipTypeEnum {
Color get color {
switch (this) {
@@ -223,4 +233,4 @@ extension ChipTypeEnumExtension on ChipTypeEnum {
return AppColors.warningLightColor; // Replace with your actual color
}
}
-}
\ No newline at end of file
+}
diff --git a/lib/features/lab/lab_repo.dart b/lib/features/lab/lab_repo.dart
new file mode 100644
index 0000000..6d2711c
--- /dev/null
+++ b/lib/features/lab/lab_repo.dart
@@ -0,0 +1,79 @@
+import 'package:hmg_patient_app_new/core/api/api_client.dart';
+import 'package:hmg_patient_app_new/core/api_consts.dart';
+import 'package:hmg_patient_app_new/core/exceptions/api_failure.dart';
+import 'package:hmg_patient_app_new/core/common_models/generic_api_model.dart';
+import 'package:dartz/dartz.dart';
+import 'package:hmg_patient_app_new/features/lab/models/resp_models/patient_lab_orders_response_model.dart';
+import 'package:hmg_patient_app_new/services/logger_service.dart';
+
+abstract class LabRepo {
+ Future>>> getPatientLabOrders({required String patientId});
+}
+
+class LabRepoImp implements LabRepo {
+ final ApiClient apiClient;
+ final LoggerService loggerService;
+
+ LabRepoImp({required this.loggerService, required this.apiClient});
+
+ @override
+ Future>>> getPatientLabOrders({required String patientId}) async {
+ final mapDevice = {
+ "isDentalAllowedBackend": false,
+ "VersionID": 50.0,
+ "Channel": 3,
+ "LanguageID": 2,
+ "IPAdress": "10.20.10.20",
+ "generalid": "Cs2020@2016\$2958",
+ "Latitude": 0.0,
+ "Longitude": 0.0,
+ "DeviceTypeID": 1,
+ "PatientType": 1,
+ "PatientTypeID": 1,
+ "TokenID": "@dm!n",
+ "PatientID": "2663907",
+ "PatientOutSA": "0",
+ "SessionID": "03478TYC02N80874CTYN04883475!?"
+ };
+
+ try {
+ GenericApiModel>? apiResponse;
+ Failure? failure;
+ await apiClient.post(
+ GET_Patient_LAB_ORDERS,
+ body: mapDevice,
+ onFailure: (error, statusCode, {messageStatus, failureType}) {
+ failure = failureType;
+ },
+ onSuccess: (response, statusCode, {messageStatus}) {
+ try {
+ final list = response['ListPLO'];
+ if (list == null || list.isEmpty) {
+ throw Exception("lab list is empty");
+ }
+
+ // final labOrders = list.map((item) => PatientLabOrdersResponseModel.fromJson(item as Map)).toList();
+ final labOrders = list
+ .map((item) => PatientLabOrdersResponseModel.fromJson(item as Map))
+ .toList()
+ .cast();
+
+ apiResponse = GenericApiModel>(
+ messageStatus: messageStatus,
+ statusCode: statusCode,
+ errorMessage: null,
+ data: labOrders,
+ );
+ } catch (e) {
+ failure = DataParsingFailure(e.toString());
+ }
+ },
+ );
+ if (failure != null) return Left(failure!);
+ if (apiResponse == null) return Left(ServerFailure("Unknown error"));
+ return Right(apiResponse!);
+ } catch (e) {
+ return Left(UnknownFailure(e.toString()));
+ }
+ }
+}
diff --git a/lib/features/lab/lab_view_model.dart b/lib/features/lab/lab_view_model.dart
new file mode 100644
index 0000000..acd87eb
--- /dev/null
+++ b/lib/features/lab/lab_view_model.dart
@@ -0,0 +1,45 @@
+import 'package:flutter/material.dart';
+import 'package:hmg_patient_app_new/features/lab/lab_repo.dart';
+import 'package:hmg_patient_app_new/features/lab/models/resp_models/patient_lab_orders_response_model.dart';
+import 'package:hmg_patient_app_new/services/error_handler_service.dart';
+
+class LabViewModel extends ChangeNotifier {
+ bool isLabOrdersLoading = false;
+ bool isLabResultsLoading = false;
+
+ LabRepo labRepo;
+ ErrorHandlerService errorHandlerService;
+
+ List patientLabOrders = [];
+
+ LabViewModel({required this.labRepo, required this.errorHandlerService});
+
+ initLabProvider() {
+ patientLabOrders.clear();
+ isLabOrdersLoading = true;
+ isLabResultsLoading = true;
+ getPatientLabOrders();
+ notifyListeners();
+ }
+
+ Future getPatientLabOrders({Function(dynamic)? onSuccess, Function(String)? onError}) async {
+ final result = await labRepo.getPatientLabOrders(patientId: "1231755");
+
+ result.fold(
+ (failure) async => await errorHandlerService.handleError(failure: failure),
+ (apiResponse) {
+ if (apiResponse.messageStatus == 2) {
+ // dialogService.showErrorDialog(message: apiResponse.errorMessage!, onOkPressed: () {});
+ } else if (apiResponse.messageStatus == 1) {
+ patientLabOrders = apiResponse.data!;
+ isLabOrdersLoading = false;
+ isLabResultsLoading = false;
+ notifyListeners();
+ if (onSuccess != null) {
+ onSuccess(apiResponse);
+ }
+ }
+ },
+ );
+ }
+}
diff --git a/lib/features/lab/models/resp_models/patient_lab_orders_response_model.dart b/lib/features/lab/models/resp_models/patient_lab_orders_response_model.dart
new file mode 100644
index 0000000..8f6dc4f
--- /dev/null
+++ b/lib/features/lab/models/resp_models/patient_lab_orders_response_model.dart
@@ -0,0 +1,245 @@
+class PatientLabOrdersResponseModel {
+ int? actualDoctorRate;
+ dynamic? admissionDate;
+ dynamic? admissionNumber;
+ dynamic? appointmentDate;
+ dynamic? appointmentNo;
+ dynamic? appointmentTime;
+ String? clinicDescription;
+ String? clinicDescriptionEnglish;
+ dynamic? clinicDescriptionN;
+ int? clinicID;
+ String? createdOn;
+ num? decimalDoctorRate;
+ int? doctorID;
+ String? doctorImageURL;
+ String? doctorName;
+ String? doctorNameEnglish;
+ dynamic? doctorNameN;
+ int? doctorRate;
+ num? doctorStarsRate;
+ String? doctorTitle;
+ int? gender;
+ String? genderDescription;
+ String? invoiceNo;
+ dynamic? invoiceNoVP;
+ String? invoiceType;
+ bool? isActiveDoctorProfile;
+ bool? isDoctorAllowVedioCall;
+ bool? isDrReviewReq;
+ bool? isExecludeDoctor;
+ bool? isInOutPatient;
+ String? isInOutPatientDescription;
+ String? isInOutPatientDescriptionN;
+ bool? isLiveCareAppointment;
+ bool? isRead;
+ bool? isSendEmail;
+ String? nationalityFlagURL;
+ int? noOfPatientsRate;
+ String? orderDate;
+ String? orderNo;
+ dynamic? orderProjectID;
+ String? patientID;
+ String? projectID;
+ String? projectName;
+ dynamic? projectNameN;
+ String? qR;
+ String? setupID;
+ List? speciality;
+ int? status;
+ String? statusDesc;
+ String? strOrderDate;
+ List? testDetails;
+
+ PatientLabOrdersResponseModel(
+ {this.actualDoctorRate,
+ this.admissionDate,
+ this.admissionNumber,
+ this.appointmentDate,
+ this.appointmentNo,
+ this.appointmentTime,
+ this.clinicDescription,
+ this.clinicDescriptionEnglish,
+ this.clinicDescriptionN,
+ this.clinicID,
+ this.createdOn,
+ this.decimalDoctorRate,
+ this.doctorID,
+ this.doctorImageURL,
+ this.doctorName,
+ this.doctorNameEnglish,
+ this.doctorNameN,
+ this.doctorRate,
+ this.doctorStarsRate,
+ this.doctorTitle,
+ this.gender,
+ this.genderDescription,
+ this.invoiceNo,
+ this.invoiceNoVP,
+ this.invoiceType,
+ this.isActiveDoctorProfile,
+ this.isDoctorAllowVedioCall,
+ this.isDrReviewReq,
+ this.isExecludeDoctor,
+ this.isInOutPatient,
+ this.isInOutPatientDescription,
+ this.isInOutPatientDescriptionN,
+ this.isLiveCareAppointment,
+ this.isRead,
+ this.isSendEmail,
+ this.nationalityFlagURL,
+ this.noOfPatientsRate,
+ this.orderDate,
+ this.orderNo,
+ this.orderProjectID,
+ this.patientID,
+ this.projectID,
+ this.projectName,
+ this.projectNameN,
+ this.qR,
+ this.setupID,
+ this.speciality,
+ this.status,
+ this.statusDesc,
+ this.strOrderDate,
+ this.testDetails});
+
+ PatientLabOrdersResponseModel.fromJson(Map json) {
+ actualDoctorRate = json['ActualDoctorRate'];
+ admissionDate = json['AdmissionDate'];
+ admissionNumber = json['AdmissionNumber'];
+ appointmentDate = json['AppointmentDate'];
+ appointmentNo = json['AppointmentNo'];
+ appointmentTime = json['AppointmentTime'];
+ clinicDescription = json['ClinicDescription'];
+ clinicDescriptionEnglish = json['ClinicDescriptionEnglish'];
+ clinicDescriptionN = json['ClinicDescriptionN'];
+ clinicID = json['ClinicID'];
+ createdOn = json['CreatedOn'];
+ decimalDoctorRate = json['DecimalDoctorRate'];
+ doctorID = json['DoctorID'];
+ doctorImageURL = json['DoctorImageURL'];
+ doctorName = json['DoctorName'];
+ doctorNameEnglish = json['DoctorNameEnglish'];
+ doctorNameN = json['DoctorNameN'];
+ doctorRate = json['DoctorRate'];
+ doctorStarsRate = json['DoctorStarsRate'];
+ doctorTitle = json['DoctorTitle'];
+ gender = json['Gender'];
+ genderDescription = json['GenderDescription'];
+ invoiceNo = json['InvoiceNo'];
+ invoiceNoVP = json['InvoiceNo_VP'];
+ invoiceType = json['InvoiceType'];
+ isActiveDoctorProfile = json['IsActiveDoctorProfile'];
+ isDoctorAllowVedioCall = json['IsDoctorAllowVedioCall'];
+ isDrReviewReq = json['IsDrReviewReq'];
+ isExecludeDoctor = json['IsExecludeDoctor'];
+ isInOutPatient = json['IsInOutPatient'];
+ isInOutPatientDescription = json['IsInOutPatientDescription'];
+ isInOutPatientDescriptionN = json['IsInOutPatientDescriptionN'];
+ isLiveCareAppointment = json['IsLiveCareAppointment'];
+ isRead = json['IsRead'];
+ isSendEmail = json['IsSendEmail'];
+ nationalityFlagURL = json['NationalityFlagURL'];
+ noOfPatientsRate = json['NoOfPatientsRate'];
+ orderDate = json['OrderDate'];
+ orderNo = json['OrderNo'];
+ orderProjectID = json['OrderProjectID'];
+ patientID = json['PatientID'];
+ projectID = json['ProjectID'];
+ projectName = json['ProjectName'];
+ projectNameN = json['ProjectNameN'];
+ qR = json['QR'];
+ setupID = json['SetupID'];
+ speciality = json['Speciality'].cast();
+ status = json['Status'];
+ statusDesc = json['StatusDesc'];
+ strOrderDate = json['StrOrderDate'];
+ if (json['TestDetails'] != dynamic) {
+ testDetails = [];
+ json['TestDetails'].forEach((v) {
+ testDetails!.add(new TestDetails.fromJson(v));
+ });
+ }
+ }
+
+ Map toJson() {
+ final Map data = new Map();
+ data['ActualDoctorRate'] = this.actualDoctorRate;
+ data['AdmissionDate'] = this.admissionDate;
+ data['AdmissionNumber'] = this.admissionNumber;
+ data['AppointmentDate'] = this.appointmentDate;
+ data['AppointmentNo'] = this.appointmentNo;
+ data['AppointmentTime'] = this.appointmentTime;
+ data['ClinicDescription'] = this.clinicDescription;
+ data['ClinicDescriptionEnglish'] = this.clinicDescriptionEnglish;
+ data['ClinicDescriptionN'] = this.clinicDescriptionN;
+ data['ClinicID'] = this.clinicID;
+ data['CreatedOn'] = this.createdOn;
+ data['DecimalDoctorRate'] = this.decimalDoctorRate;
+ data['DoctorID'] = this.doctorID;
+ data['DoctorImageURL'] = this.doctorImageURL;
+ data['DoctorName'] = this.doctorName;
+ data['DoctorNameEnglish'] = this.doctorNameEnglish;
+ data['DoctorNameN'] = this.doctorNameN;
+ data['DoctorRate'] = this.doctorRate;
+ data['DoctorStarsRate'] = this.doctorStarsRate;
+ data['DoctorTitle'] = this.doctorTitle;
+ data['Gender'] = this.gender;
+ data['GenderDescription'] = this.genderDescription;
+ data['InvoiceNo'] = this.invoiceNo;
+ data['InvoiceNo_VP'] = this.invoiceNoVP;
+ data['InvoiceType'] = this.invoiceType;
+ data['IsActiveDoctorProfile'] = this.isActiveDoctorProfile;
+ data['IsDoctorAllowVedioCall'] = this.isDoctorAllowVedioCall;
+ data['IsDrReviewReq'] = this.isDrReviewReq;
+ data['IsExecludeDoctor'] = this.isExecludeDoctor;
+ data['IsInOutPatient'] = this.isInOutPatient;
+ data['IsInOutPatientDescription'] = this.isInOutPatientDescription;
+ data['IsInOutPatientDescriptionN'] = this.isInOutPatientDescriptionN;
+ data['IsLiveCareAppointment'] = this.isLiveCareAppointment;
+ data['IsRead'] = this.isRead;
+ data['IsSendEmail'] = this.isSendEmail;
+ data['NationalityFlagURL'] = this.nationalityFlagURL;
+ data['NoOfPatientsRate'] = this.noOfPatientsRate;
+ data['OrderDate'] = this.orderDate;
+ data['OrderNo'] = this.orderNo;
+ data['OrderProjectID'] = this.orderProjectID;
+ data['PatientID'] = this.patientID;
+ data['ProjectID'] = this.projectID;
+ data['ProjectName'] = this.projectName;
+ data['ProjectNameN'] = this.projectNameN;
+ data['QR'] = this.qR;
+ data['SetupID'] = this.setupID;
+ data['Speciality'] = this.speciality;
+ data['Status'] = this.status;
+ data['StatusDesc'] = this.statusDesc;
+ data['StrOrderDate'] = this.strOrderDate;
+ if (this.testDetails != dynamic) {
+ data['TestDetails'] = this.testDetails!.map((v) => v.toJson()).toList();
+ }
+ return data;
+ }
+}
+
+class TestDetails {
+ String? description;
+ String? testCode;
+ String? testID;
+
+ TestDetails({this.description, this.testCode, this.testID});
+
+ TestDetails.fromJson(Map json) {
+ description = json['Description'];
+ testCode = json['TestCode'];
+ testID = json['TestID'];
+ }
+
+ Map toJson() {
+ final Map data = new Map();
+ data['Description'] = this.description;
+ data['TestCode'] = this.testCode;
+ data['TestID'] = this.testID;
+ return data;
+ }
+}
diff --git a/lib/main.dart b/lib/main.dart
index bb4332b..3f09649 100644
--- a/lib/main.dart
+++ b/lib/main.dart
@@ -7,7 +7,7 @@ import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:hmg_patient_app_new/core/dependencies.dart';
import 'package:hmg_patient_app_new/features/authentication/authentication_view_model.dart';
-import 'package:hmg_patient_app_new/providers/bottom_navigation_provider.dart';
+import 'package:hmg_patient_app_new/features/lab/lab_view_model.dart';
import 'package:hmg_patient_app_new/routes/app_routes.dart';
import 'package:hmg_patient_app_new/services/logger_service.dart';
import 'package:hmg_patient_app_new/services/navigation_service.dart';
@@ -51,8 +51,11 @@ void main() async {
path: 'assets/langs',
fallbackLocale: Locale('en', 'US'),
child: MultiProvider(providers: [
- ChangeNotifierProvider(
- create: (_) => BottomNavigationProvider(),
+ ChangeNotifierProvider(
+ create: (_) => LabViewModel(
+ labRepo: getIt(),
+ errorHandlerService: getIt(),
+ ),
),
ChangeNotifierProvider(
create: (_) => AuthenticationViewModel(
diff --git a/lib/presentation/home/data/landing_page_data.dart b/lib/presentation/home/data/landing_page_data.dart
index af43b9f..8474422 100644
--- a/lib/presentation/home/data/landing_page_data.dart
+++ b/lib/presentation/home/data/landing_page_data.dart
@@ -8,6 +8,7 @@ import 'package:hmg_patient_app_new/theme/colors.dart';
class LandingPageData {
static List getNotLoggedInServiceCardsList = [
ServiceCardData(
+ serviceName: "emergency",
icon: AppAssets.emergency_services_icon,
title: "Emergency",
subtitle: "Services",
@@ -17,6 +18,7 @@ class LandingPageData {
isBold: true,
),
ServiceCardData(
+ serviceName: "indoor_navigation",
icon: AppAssets.indoor_nav_icon,
title: "Indoor",
subtitle: "Navigation",
@@ -26,6 +28,7 @@ class LandingPageData {
isBold: false,
),
ServiceCardData(
+ serviceName: "search_doctor",
icon: AppAssets.search_doctor_icon,
title: "Search",
subtitle: "Doctor",
@@ -35,6 +38,7 @@ class LandingPageData {
isBold: false,
),
ServiceCardData(
+ serviceName: "health_calculators",
icon: AppAssets.health_calculators_icon,
title: "Health",
subtitle: "Calculators",
@@ -44,6 +48,7 @@ class LandingPageData {
isBold: false,
),
ServiceCardData(
+ serviceName: "health_converters",
icon: AppAssets.health_calculators_icon,
title: "Health",
subtitle: "Converters",
@@ -53,6 +58,7 @@ class LandingPageData {
isBold: false,
),
ServiceCardData(
+ serviceName: "parking_guide",
icon: AppAssets.health_calculators_icon,
title: "Parking",
subtitle: "Guide",
@@ -65,6 +71,7 @@ class LandingPageData {
static List getLoggedInServiceCardsList = [
ServiceCardData(
+ serviceName: "emergency",
icon: AppAssets.emergency_services_icon,
title: "Emergency",
subtitle: "Services",
@@ -74,6 +81,7 @@ class LandingPageData {
isBold: true,
),
ServiceCardData(
+ serviceName: "lab_results",
icon: AppAssets.lab_result_icon,
title: "My Lab",
subtitle: "Results",
@@ -83,6 +91,17 @@ class LandingPageData {
isBold: false,
),
ServiceCardData(
+ serviceName: "radiology_results",
+ icon: AppAssets.lab_result_icon,
+ title: "My Radiology",
+ subtitle: "Results",
+ backgroundColor: AppColors.whiteColor,
+ iconColor: AppColors.blackColor,
+ textColor: AppColors.blackColor,
+ isBold: false,
+ ),
+ ServiceCardData(
+ serviceName: "prescriptions",
icon: AppAssets.my_prescription_icon,
title: "My",
subtitle: "Prescriptions",
@@ -92,6 +111,7 @@ class LandingPageData {
isBold: false,
),
ServiceCardData(
+ serviceName: "insurance_update",
icon: AppAssets.insurance_update_icon,
title: "Insurance",
subtitle: "Update",
@@ -101,6 +121,7 @@ class LandingPageData {
isBold: false,
),
ServiceCardData(
+ serviceName: "my_doctors",
icon: AppAssets.insurance_update_icon,
title: "My",
subtitle: "Doctors",
@@ -110,6 +131,7 @@ class LandingPageData {
isBold: false,
),
ServiceCardData(
+ serviceName: "sick_leaves",
icon: AppAssets.insurance_update_icon,
title: "My Sick",
subtitle: "Leaves",
diff --git a/lib/presentation/home/data/service_card_data.dart b/lib/presentation/home/data/service_card_data.dart
index 856a15e..49e7e3d 100644
--- a/lib/presentation/home/data/service_card_data.dart
+++ b/lib/presentation/home/data/service_card_data.dart
@@ -3,6 +3,7 @@ import 'dart:ui';
import 'package:hmg_patient_app_new/theme/colors.dart';
class ServiceCardData {
+ final String serviceName;
final String icon;
final String title;
final String subtitle;
@@ -13,6 +14,7 @@ class ServiceCardData {
final String largeCardIcon;
ServiceCardData({
+ this.serviceName = "",
this.icon = "",
this.title = "",
this.subtitle = "",
diff --git a/lib/presentation/home/landing_page.dart b/lib/presentation/home/landing_page.dart
index f2017b2..c305110 100644
--- a/lib/presentation/home/landing_page.dart
+++ b/lib/presentation/home/landing_page.dart
@@ -17,7 +17,6 @@ import 'package:hmg_patient_app_new/presentation/home/widgets/habib_wallet_card.
import 'package:hmg_patient_app_new/presentation/home/widgets/large_service_card.dart';
import 'package:hmg_patient_app_new/presentation/home/widgets/small_service_card.dart';
import 'package:hmg_patient_app_new/presentation/medical_file/medical_file_page.dart';
-import 'package:hmg_patient_app_new/providers/bottom_navigation_provider.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/transitions/fade_page.dart';
@@ -35,248 +34,245 @@ class _LandingPageState extends State {
Widget build(BuildContext context) {
AppState appState = getIt.get();
final AuthenticationViewModel authenticationViewModel = context.read();
- return Consumer(builder: (context, navigationProvider, child) {
- return Scaffold(
- backgroundColor: AppColors.bgScaffoldColor,
- body: Padding(
- padding: EdgeInsets.all(24.h),
- child: SingleChildScrollView(
- child: Column(
- children: [
- Padding(
- padding: EdgeInsets.only(top: 50.0),
- child: Row(
- mainAxisAlignment: MainAxisAlignment.spaceBetween,
- children: [
- CustomButton(
- text: LocaleKeys.loginOrRegister.tr(context: context),
- onPressed: () async {
-
- // await authenticationViewModel.selectDeviceImei();
- Navigator.of(context).push(MaterialPageRoute(builder: (BuildContext context) => LoginScreen()));
- },
- backgroundColor: Color(0xffFEE9EA),
- borderColor: Color(0xffFEE9EA),
- textColor: Color(0xffED1C2B),
- fontSize: 16,
- fontWeight: FontWeight.w500,
- borderRadius: 12,
- padding: EdgeInsets.fromLTRB(10, 0, 10, 0),
- height: 50,
- ),
- Utils.buildSvgWithAssets(
- icon: AppAssets.contact_icon,
- width: 24,
- height: 24,
- ).onPress(() {
- Navigator.of(context).push(
- FadePage(
- page: MedicalFilePage(),
- // page: LoginScreen(),
- ),
- );
- }),
- ],
- ),
+ return Scaffold(
+ backgroundColor: AppColors.bgScaffoldColor,
+ body: Padding(
+ padding: EdgeInsets.all(24.h),
+ child: SingleChildScrollView(
+ child: Column(
+ children: [
+ Padding(
+ padding: EdgeInsets.only(top: 50.0),
+ child: Row(
+ mainAxisAlignment: MainAxisAlignment.spaceBetween,
+ children: [
+ CustomButton(
+ text: LocaleKeys.loginOrRegister.tr(context: context),
+ onPressed: () async {
+ await authenticationViewModel.selectDeviceImei();
+ },
+ backgroundColor: Color(0xffFEE9EA),
+ borderColor: Color(0xffFEE9EA),
+ textColor: Color(0xffED1C2B),
+ fontSize: 16,
+ fontWeight: FontWeight.w500,
+ borderRadius: 12,
+ padding: EdgeInsets.fromLTRB(10, 0, 10, 0),
+ height: 50,
+ ),
+ Utils.buildSvgWithAssets(
+ icon: AppAssets.contact_icon,
+ width: 24,
+ height: 24,
+ ).onPress(() {
+ Navigator.of(context).push(
+ FadePage(
+ page: MedicalFilePage(),
+ // page: LoginScreen(),
+ ),
+ );
+ }),
+ ],
),
- SizedBox(height: 16.h),
- appState.isAuthenticated
- ? Column(
- children: [
- Container(
- width: double.infinity,
- decoration: RoundedRectangleBorder().toSmoothCornerDecoration(
- color: AppColors.whiteColor,
- borderRadius: 24,
- ),
- child: Padding(
- padding: EdgeInsets.all(12.h),
- child: Column(
- children: [
- Utils.buildSvgWithAssets(icon: AppAssets.home_calendar_icon, width: 32.h, height: 32.h),
- SizedBox(height: 12.h),
- "You do not have any upcoming appointment. Please book an appointment".toText12(isCenter: true),
- SizedBox(height: 12.h),
- CustomButton(
- text: LocaleKeys.bookAppo.tr(context: context),
- onPressed: () {
- Navigator.of(context).pushReplacement(
- MaterialPageRoute(builder: (BuildContext context) => LandingPage()),
- );
- },
- backgroundColor: Color(0xffFEE9EA),
- borderColor: Color(0xffFEE9EA),
- textColor: Color(0xffED1C2B),
- fontSize: 14,
- fontWeight: FontWeight.w500,
- borderRadius: 12,
- padding: EdgeInsets.fromLTRB(10, 0, 10, 0),
- height: 40,
- icon: AppAssets.add_icon,
- iconColor: AppColors.primaryRedColor,
- ),
- ],
- ),
- ),
+ ),
+ SizedBox(height: 16.h),
+ appState.isAuthenticated
+ ? Column(
+ children: [
+ Container(
+ width: double.infinity,
+ decoration: RoundedRectangleBorder().toSmoothCornerDecoration(
+ color: AppColors.whiteColor,
+ borderRadius: 24,
),
- SizedBox(height: 12.h),
- Row(
- mainAxisAlignment: MainAxisAlignment.spaceBetween,
- children: [
- "Quick Links".toText16(isBold: true),
- Row(
- children: [
- "View medical file".toText12(color: AppColors.primaryRedColor),
- SizedBox(width: 2.h),
- Icon(Icons.arrow_forward_ios, color: AppColors.primaryRedColor, size: 10.h),
- ],
- ),
- ],
+ child: Padding(
+ padding: EdgeInsets.all(12.h),
+ child: Column(
+ children: [
+ Utils.buildSvgWithAssets(icon: AppAssets.home_calendar_icon, width: 32.h, height: 32.h),
+ SizedBox(height: 12.h),
+ "You do not have any upcoming appointment. Please book an appointment".toText12(isCenter: true),
+ SizedBox(height: 12.h),
+ CustomButton(
+ text: LocaleKeys.bookAppo.tr(context: context),
+ onPressed: () {
+ Navigator.of(context).pushReplacement(
+ MaterialPageRoute(builder: (BuildContext context) => LandingPage()),
+ );
+ },
+ backgroundColor: Color(0xffFEE9EA),
+ borderColor: Color(0xffFEE9EA),
+ textColor: Color(0xffED1C2B),
+ fontSize: 14,
+ fontWeight: FontWeight.w500,
+ borderRadius: 12,
+ padding: EdgeInsets.fromLTRB(10, 0, 10, 0),
+ height: 40,
+ icon: AppAssets.add_icon,
+ iconColor: AppColors.primaryRedColor,
+ ),
+ ],
+ ),
),
- SizedBox(height: 12.h),
- Container(
- height: 127.h,
- decoration: RoundedRectangleBorder().toSmoothCornerDecoration(
- color: AppColors.whiteColor,
- borderRadius: 24,
+ ),
+ SizedBox(height: 12.h),
+ Row(
+ mainAxisAlignment: MainAxisAlignment.spaceBetween,
+ children: [
+ "Quick Links".toText16(isBold: true),
+ Row(
+ children: [
+ "View medical file".toText12(color: AppColors.primaryRedColor),
+ SizedBox(width: 2.h),
+ Icon(Icons.arrow_forward_ios, color: AppColors.primaryRedColor, size: 10.h),
+ ],
),
- child: Padding(
- padding: EdgeInsets.all(16.h),
- child: Column(
- children: [
- Expanded(
- child: ListView.separated(
- scrollDirection: Axis.horizontal,
- itemCount: LandingPageData.getLoggedInServiceCardsList.length,
- shrinkWrap: true,
- padding: const EdgeInsets.only(left: 0, right: 8),
- itemBuilder: (context, index) {
- return AnimationConfiguration.staggeredList(
- position: index,
- duration: const Duration(milliseconds: 1000),
- child: SlideAnimation(
- horizontalOffset: 100.0,
- child: FadeInAnimation(
- child: SmallServiceCard(
- icon: LandingPageData.getLoggedInServiceCardsList[index].icon,
- title: LandingPageData.getLoggedInServiceCardsList[index].title,
- subtitle: LandingPageData.getLoggedInServiceCardsList[index].subtitle,
- iconColor: LandingPageData.getLoggedInServiceCardsList[index].iconColor,
- textColor: LandingPageData.getLoggedInServiceCardsList[index].textColor,
- backgroundColor: LandingPageData.getLoggedInServiceCardsList[index].backgroundColor,
- isBold: LandingPageData.getLoggedInServiceCardsList[index].isBold,
- ),
+ ],
+ ),
+ SizedBox(height: 12.h),
+ Container(
+ height: 127.h,
+ decoration: RoundedRectangleBorder().toSmoothCornerDecoration(
+ color: AppColors.whiteColor,
+ borderRadius: 24,
+ ),
+ child: Padding(
+ padding: EdgeInsets.all(16.h),
+ child: Column(
+ children: [
+ Expanded(
+ child: ListView.separated(
+ scrollDirection: Axis.horizontal,
+ itemCount: LandingPageData.getLoggedInServiceCardsList.length,
+ shrinkWrap: true,
+ padding: const EdgeInsets.only(left: 0, right: 8),
+ itemBuilder: (context, index) {
+ return AnimationConfiguration.staggeredList(
+ position: index,
+ duration: const Duration(milliseconds: 1000),
+ child: SlideAnimation(
+ horizontalOffset: 100.0,
+ child: FadeInAnimation(
+ child: SmallServiceCard(
+ serviceName: LandingPageData.getLoggedInServiceCardsList[index].serviceName,
+ icon: LandingPageData.getLoggedInServiceCardsList[index].icon,
+ title: LandingPageData.getLoggedInServiceCardsList[index].title,
+ subtitle: LandingPageData.getLoggedInServiceCardsList[index].subtitle,
+ iconColor: LandingPageData.getLoggedInServiceCardsList[index].iconColor,
+ textColor: LandingPageData.getLoggedInServiceCardsList[index].textColor,
+ backgroundColor: LandingPageData.getLoggedInServiceCardsList[index].backgroundColor,
+ isBold: LandingPageData.getLoggedInServiceCardsList[index].isBold,
),
),
- );
- },
- separatorBuilder: (BuildContext cxt, int index) => 0.width,
- ),
+ ),
+ );
+ },
+ separatorBuilder: (BuildContext cxt, int index) => 0.width,
),
- ],
- ),
+ ),
+ ],
),
- )
- ],
- )
- : Container(
- height: 127.h,
- decoration: RoundedRectangleBorder().toSmoothCornerDecoration(
- color: AppColors.whiteColor,
- borderRadius: 24,
- ),
- child: Padding(
- padding: EdgeInsets.all(16.h),
- child: Column(
- children: [
- Expanded(
- child: ListView.separated(
- scrollDirection: Axis.horizontal,
- itemCount: LandingPageData.getNotLoggedInServiceCardsList.length,
- shrinkWrap: true,
- padding: const EdgeInsets.only(left: 0, right: 8),
- itemBuilder: (context, index) {
- return AnimationConfiguration.staggeredList(
- position: index,
- duration: const Duration(milliseconds: 1000),
- child: SlideAnimation(
- horizontalOffset: 100.0,
- child: FadeInAnimation(
- child: SmallServiceCard(
- icon: LandingPageData.getNotLoggedInServiceCardsList[index].icon,
- title: LandingPageData.getNotLoggedInServiceCardsList[index].title,
- subtitle: LandingPageData.getNotLoggedInServiceCardsList[index].subtitle,
- iconColor: LandingPageData.getNotLoggedInServiceCardsList[index].iconColor,
- textColor: LandingPageData.getNotLoggedInServiceCardsList[index].textColor,
- backgroundColor: LandingPageData.getNotLoggedInServiceCardsList[index].backgroundColor,
- isBold: LandingPageData.getNotLoggedInServiceCardsList[index].isBold,
- ),
+ ),
+ )
+ ],
+ )
+ : Container(
+ height: 127.h,
+ decoration: RoundedRectangleBorder().toSmoothCornerDecoration(
+ color: AppColors.whiteColor,
+ borderRadius: 24,
+ ),
+ child: Padding(
+ padding: EdgeInsets.all(16.h),
+ child: Column(
+ children: [
+ Expanded(
+ child: ListView.separated(
+ scrollDirection: Axis.horizontal,
+ itemCount: LandingPageData.getNotLoggedInServiceCardsList.length,
+ shrinkWrap: true,
+ padding: const EdgeInsets.only(left: 0, right: 8),
+ itemBuilder: (context, index) {
+ return AnimationConfiguration.staggeredList(
+ position: index,
+ duration: const Duration(milliseconds: 1000),
+ child: SlideAnimation(
+ horizontalOffset: 100.0,
+ child: FadeInAnimation(
+ child: SmallServiceCard(
+ icon: LandingPageData.getNotLoggedInServiceCardsList[index].icon,
+ title: LandingPageData.getNotLoggedInServiceCardsList[index].title,
+ subtitle: LandingPageData.getNotLoggedInServiceCardsList[index].subtitle,
+ iconColor: LandingPageData.getNotLoggedInServiceCardsList[index].iconColor,
+ textColor: LandingPageData.getNotLoggedInServiceCardsList[index].textColor,
+ backgroundColor: LandingPageData.getNotLoggedInServiceCardsList[index].backgroundColor,
+ isBold: LandingPageData.getNotLoggedInServiceCardsList[index].isBold,
),
),
- );
- },
- separatorBuilder: (BuildContext cxt, int index) => 0.width,
- ),
+ ),
+ );
+ },
+ separatorBuilder: (BuildContext cxt, int index) => 0.width,
),
- ],
- ),
+ ),
+ ],
),
),
- SizedBox(height: 16.h),
- Row(
- mainAxisAlignment: MainAxisAlignment.spaceBetween,
- children: [
- "Services".toText16(isBold: true),
- Row(
- children: [
- "View all services".toText12(color: AppColors.primaryRedColor),
- SizedBox(width: 2.h),
- Icon(Icons.arrow_forward_ios, color: AppColors.primaryRedColor, size: 10.h),
- ],
),
- ],
- ),
- SizedBox(height: 16.h),
- SizedBox(
- height: 325.h,
- child: Column(
+ SizedBox(height: 16.h),
+ Row(
+ mainAxisAlignment: MainAxisAlignment.spaceBetween,
+ children: [
+ "Services".toText16(isBold: true),
+ Row(
children: [
- Expanded(
- child: ListView.separated(
- scrollDirection: Axis.horizontal,
- itemCount: LandingPageData.getServiceCardsList.length,
- shrinkWrap: true,
- padding: const EdgeInsets.only(left: 0, right: 8),
- itemBuilder: (context, index) {
- return AnimationConfiguration.staggeredList(
- position: index,
- duration: const Duration(milliseconds: 1000),
- child: SlideAnimation(
- horizontalOffset: 100.0,
- child: FadeInAnimation(
- child: LargeServiceCard(
- image: LandingPageData.getServiceCardsList[index].icon,
- title: LandingPageData.getServiceCardsList[index].title,
- subtitle: LandingPageData.getServiceCardsList[index].subtitle,
- icon: LandingPageData.getServiceCardsList[index].largeCardIcon,
- ),
+ "View all services".toText12(color: AppColors.primaryRedColor),
+ SizedBox(width: 2.h),
+ Icon(Icons.arrow_forward_ios, color: AppColors.primaryRedColor, size: 10.h),
+ ],
+ ),
+ ],
+ ),
+ SizedBox(height: 16.h),
+ SizedBox(
+ height: 325.h,
+ child: Column(
+ children: [
+ Expanded(
+ child: ListView.separated(
+ scrollDirection: Axis.horizontal,
+ itemCount: LandingPageData.getServiceCardsList.length,
+ shrinkWrap: true,
+ padding: const EdgeInsets.only(left: 0, right: 8),
+ itemBuilder: (context, index) {
+ return AnimationConfiguration.staggeredList(
+ position: index,
+ duration: const Duration(milliseconds: 1000),
+ child: SlideAnimation(
+ horizontalOffset: 100.0,
+ child: FadeInAnimation(
+ child: LargeServiceCard(
+ image: LandingPageData.getServiceCardsList[index].icon,
+ title: LandingPageData.getServiceCardsList[index].title,
+ subtitle: LandingPageData.getServiceCardsList[index].subtitle,
+ icon: LandingPageData.getServiceCardsList[index].largeCardIcon,
),
),
- );
- },
- separatorBuilder: (BuildContext cxt, int index) => 0.width,
- ),
+ ),
+ );
+ },
+ separatorBuilder: (BuildContext cxt, int index) => 0.width,
),
- ],
- ),
+ ),
+ ],
),
- SizedBox(height: 16.h),
- appState.isAuthenticated ? HabibWalletCard() : SizedBox(),
- ],
- ),
+ ),
+ SizedBox(height: 16.h),
+ appState.isAuthenticated ? HabibWalletCard() : SizedBox(),
+ ],
),
),
- );
- });
+ ),
+ );
}
}
diff --git a/lib/presentation/home/widgets/small_service_card.dart b/lib/presentation/home/widgets/small_service_card.dart
index a138db6..0983a06 100644
--- a/lib/presentation/home/widgets/small_service_card.dart
+++ b/lib/presentation/home/widgets/small_service_card.dart
@@ -2,11 +2,14 @@ import 'package:flutter/material.dart';
import 'package:hmg_patient_app_new/core/utils/size_utils.dart';
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/presentation/lab/lab_orders_page.dart';
+import 'package:hmg_patient_app_new/widgets/transitions/fade_page.dart';
import '../../../core/utils/utils.dart';
import '../../../theme/colors.dart';
class SmallServiceCard extends StatelessWidget {
+ final String serviceName;
final String icon;
final String title;
final String subtitle;
@@ -18,6 +21,7 @@ class SmallServiceCard extends StatelessWidget {
SmallServiceCard({
super.key,
this.icon = "",
+ this.serviceName = "",
this.title = "",
this.subtitle = "",
this.backgroundColor = AppColors.whiteColor,
@@ -48,6 +52,25 @@ class SmallServiceCard extends StatelessWidget {
),
),
),
- );
+ ).onPress(() {
+ switch (serviceName) {
+ case "lab_results":
+ Navigator.of(context).push(
+ FadePage(
+ page: LabOrdersPage(),
+ ),
+ );
+ break;
+ case "radiology_results":
+ break;
+ case "prescriptions":
+ break;
+ case "insurance_update":
+ break;
+ default:
+ // Handle unknown service
+ break;
+ }
+ });
}
}
diff --git a/lib/presentation/lab/lab_orders_page.dart b/lib/presentation/lab/lab_orders_page.dart
new file mode 100644
index 0000000..7854ee8
--- /dev/null
+++ b/lib/presentation/lab/lab_orders_page.dart
@@ -0,0 +1,212 @@
+import 'dart:async';
+
+import 'package:easy_localization/easy_localization.dart';
+import 'package:flutter/material.dart';
+import 'package:flutter_staggered_animations/flutter_staggered_animations.dart';
+import 'package:hmg_patient_app_new/core/app_assets.dart';
+import 'package:hmg_patient_app_new/core/utils/date_util.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/string_extensions.dart';
+import 'package:hmg_patient_app_new/extensions/widget_extensions.dart';
+import 'package:hmg_patient_app_new/generated/locale_keys.g.dart';
+import 'package:hmg_patient_app_new/features/lab/lab_view_model.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/shimmer/movies_shimmer_widget.dart';
+import 'package:provider/provider.dart';
+
+class LabOrdersPage extends StatefulWidget {
+ const LabOrdersPage({super.key});
+
+ @override
+ State createState() => _LabOrdersPageState();
+}
+
+class _LabOrdersPageState extends State {
+ late LabViewModel labProvider;
+
+ int? expandedIndex;
+
+ // Sample data for demonstration
+ final List labOrders = [
+ 'Mohammad Al Harbi',
+ 'Mohammad Al Harbi',
+ 'Mohammad Al Harbi',
+ 'Mohammad Al Harbi',
+ ];
+
+ @override
+ void initState() {
+ scheduleMicrotask(() {
+ labProvider.initLabProvider();
+ });
+ super.initState();
+ }
+
+ @override
+ Widget build(BuildContext context) {
+ labProvider = Provider.of(context);
+ return Scaffold(
+ backgroundColor: AppColors.bgScaffoldColor,
+ appBar: AppBar(
+ title: const Text('Lab Results'),
+ backgroundColor: AppColors.bgScaffoldColor,
+ ),
+ body: Padding(
+ padding: EdgeInsets.all(24.h),
+ child: SingleChildScrollView(
+ child: Consumer(
+ builder: (context, model, child) {
+ return Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ Row(
+ mainAxisAlignment: MainAxisAlignment.spaceBetween,
+ children: [
+ LocaleKeys.labResults.tr(context: context).toText24(isBold: true),
+ Utils.buildSvgWithAssets(icon: AppAssets.search_icon),
+ ],
+ ),
+ SizedBox(height: 16.h),
+ // Build Tab Bar
+ SizedBox(height: 16.h),
+ // Expandable list
+ ListView.builder(
+ shrinkWrap: true,
+ physics: NeverScrollableScrollPhysics(),
+ itemCount: model.isLabOrdersLoading ? 5 : model.patientLabOrders.length,
+ itemBuilder: (context, index) {
+ final isExpanded = expandedIndex == index;
+ return model.isLabOrdersLoading
+ ? const MoviesShimmerWidget()
+ : AnimationConfiguration.staggeredList(
+ position: index,
+ duration: const Duration(milliseconds: 500),
+ child: SlideAnimation(
+ verticalOffset: 100.0,
+ child: FadeInAnimation(
+ child: AnimatedContainer(
+ duration: Duration(milliseconds: 300),
+ curve: Curves.easeInOut,
+ margin: EdgeInsets.symmetric(vertical: 8.h),
+ decoration: RoundedRectangleBorder().toSmoothCornerDecoration(color: AppColors.whiteColor, borderRadius: 20.h, hasShadow: true),
+ child: InkWell(
+ onTap: () {
+ setState(() {
+ expandedIndex = isExpanded ? null : index;
+ });
+ },
+ child: Column(
+ children: [
+ Padding(
+ padding: EdgeInsets.all(16.h),
+ child: Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ Row(
+ mainAxisAlignment: MainAxisAlignment.spaceBetween,
+ children: [
+ CustomButton(
+ text: LocaleKeys.pending.tr(context: context),
+ onPressed: () {},
+ backgroundColor: getLabOrderStatusColor(model.patientLabOrders[index].status!).withOpacity(0.15),
+ borderColor: getLabOrderStatusColor(model.patientLabOrders[index].status!).withOpacity(0.01),
+ textColor: getLabOrderStatusColor(model.patientLabOrders[index].status!),
+ fontSize: 10,
+ fontWeight: FontWeight.w500,
+ borderRadius: 8,
+ padding: EdgeInsets.fromLTRB(10, 0, 10, 0),
+ height: 30.h,
+ ),
+ Icon(isExpanded ? Icons.expand_less : Icons.expand_more),
+ ],
+ ),
+ SizedBox(height: 8.h),
+ Row(
+ children: [
+ Image.network(
+ model.patientLabOrders[index].doctorImageURL!,
+ width: 24.h,
+ height: 24.h,
+ fit: BoxFit.fill,
+ ).circle(100),
+ SizedBox(width: 4.h),
+ model.patientLabOrders[index].doctorName!.toText16(isBold: true)
+ ],
+ ),
+ SizedBox(height: 8.h),
+ Row(
+ children: [
+ CustomButton(
+ text: DateUtil.formatDateToDate(DateUtil.convertStringToDate(model.patientLabOrders[index].createdOn), false),
+ onPressed: () {},
+ backgroundColor: AppColors.greyColor,
+ borderColor: AppColors.greyColor,
+ textColor: AppColors.blackColor,
+ fontSize: 12,
+ fontWeight: FontWeight.w500,
+ borderRadius: 8,
+ padding: EdgeInsets.fromLTRB(10, 0, 10, 0),
+ height: 24.h,
+ ),
+ SizedBox(width: 8.h),
+ CustomButton(
+ text: model.patientLabOrders[index].clinicDescription!,
+ onPressed: () {},
+ backgroundColor: AppColors.greyColor,
+ borderColor: AppColors.greyColor,
+ textColor: AppColors.blackColor,
+ fontSize: 12,
+ fontWeight: FontWeight.w500,
+ borderRadius: 8,
+ padding: EdgeInsets.fromLTRB(10, 0, 10, 0),
+ height: 24.h,
+ ),
+ ],
+ ),
+ ],
+ ),
+ ),
+ AnimatedCrossFade(
+ firstChild: SizedBox.shrink(),
+ secondChild: Padding(
+ padding: EdgeInsets.symmetric(horizontal: 16.h, vertical: 8.h),
+ child: Text('Details for ${model.patientLabOrders[index].clinicDescription}'),
+ ),
+ crossFadeState: isExpanded ? CrossFadeState.showSecond : CrossFadeState.showFirst,
+ duration: Duration(milliseconds: 300),
+ ),
+ ],
+ ),
+ ),
+ ),
+ ),
+ ),
+ );
+ },
+ ),
+ ],
+ );
+ },
+ ),
+ ),
+ ),
+ );
+ }
+
+ Color getLabOrderStatusColor(num status) {
+ switch (status) {
+ case 44:
+ return AppColors.warningColorYellow;
+ case 45:
+ return AppColors.warningColorYellow;
+ case 16:
+ return AppColors.successColor;
+ case 17:
+ return AppColors.successColor;
+ default:
+ return AppColors.greyColor;
+ }
+ }
+}
diff --git a/lib/presentation/medical_file/medical_file_page.dart b/lib/presentation/medical_file/medical_file_page.dart
index ba274bf..9b2265c 100644
--- a/lib/presentation/medical_file/medical_file_page.dart
+++ b/lib/presentation/medical_file/medical_file_page.dart
@@ -5,6 +5,7 @@ import 'package:hmg_patient_app_new/core/utils/size_utils.dart';
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/generated/locale_keys.g.dart';
+import 'package:hmg_patient_app_new/presentation/medical_file/widgets/medical_file_card.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/input_widget.dart';
@@ -85,9 +86,6 @@ class MedicalFilePage extends StatelessWidget {
),
SizedBox(width: 4.h),
CustomButton(
- icon: AppAssets.checkmark_icon,
- iconColor: AppColors.successColor,
- iconSize: 13.h,
text: LocaleKeys.verified.tr(context: context),
onPressed: () {},
backgroundColor: AppColors.greyColor,
@@ -160,7 +158,117 @@ class MedicalFilePage extends StatelessWidget {
],
),
),
- )
+ ),
+ SizedBox(height: 16.h),
+ //Insurance Tab Data
+ Container(
+ // height: 150.h,
+ width: double.infinity,
+ decoration: RoundedRectangleBorder().toSmoothCornerDecoration(
+ color: AppColors.whiteColor,
+ borderRadius: 24,
+ ),
+ child: Padding(
+ padding: EdgeInsets.all(16.h),
+ child: Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ Row(
+ mainAxisAlignment: MainAxisAlignment.spaceBetween,
+ children: [
+ Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ "Haroon Amjad".toText18(isBold: true),
+ "Policy: 223123345".toText12(isBold: true, color: AppColors.lightGrayColor),
+ ],
+ ),
+ CustomButton(
+ icon: AppAssets.cross_circle,
+ iconColor: AppColors.primaryRedColor,
+ iconSize: 13.h,
+ text: "Insurance Expired",
+ onPressed: () {},
+ backgroundColor: AppColors.primaryRedColor.withOpacity(0.1),
+ borderColor: AppColors.primaryRedColor.withOpacity(0.0),
+ textColor: AppColors.primaryRedColor,
+ fontSize: 10,
+ fontWeight: FontWeight.w500,
+ borderRadius: 12,
+ padding: EdgeInsets.fromLTRB(10, 0, 10, 0),
+ height: 30.h,
+ ),
+ ],
+ ),
+ SizedBox(height: 12.h),
+ "NCCI".toText12(isBold: true),
+ "NC_Dr Sulaiman Al Habib Medical Group".toText12(isBold: true),
+ SizedBox(height: 8.h),
+ Row(
+ children: [
+ CustomButton(
+ icon: AppAssets.cross_circle,
+ iconColor: AppColors.primaryRedColor,
+ iconSize: 13.h,
+ text: "Expiry: 18 Mar, 2025",
+ onPressed: () {},
+ backgroundColor: AppColors.primaryRedColor.withOpacity(0.1),
+ borderColor: AppColors.primaryRedColor.withOpacity(0.0),
+ textColor: AppColors.primaryRedColor,
+ fontSize: 10,
+ fontWeight: FontWeight.w500,
+ borderRadius: 12,
+ padding: EdgeInsets.fromLTRB(10, 0, 10, 0),
+ height: 30.h,
+ ),
+ SizedBox(width: 5.h),
+ CustomButton(
+ text: "Patient Card ID: 3628599",
+ onPressed: () {},
+ backgroundColor: AppColors.greyColor,
+ borderColor: AppColors.greyColor,
+ textColor: AppColors.blackColor,
+ fontSize: 10,
+ fontWeight: FontWeight.normal,
+ borderRadius: 12,
+ padding: EdgeInsets.fromLTRB(10, 0, 10, 0),
+ height: 30.h,
+ ),
+ ],
+ ),
+ SizedBox(height: 10.h),
+ CustomButton(
+ icon: AppAssets.cross_circle,
+ iconColor: AppColors.primaryRedColor,
+ iconSize: 13.h,
+ text: "${LocaleKeys.updateInsurance.tr(context: context)} ${LocaleKeys.updateInsuranceSubtitle.tr(context: context)}",
+ onPressed: () {},
+ backgroundColor: AppColors.bgGreenColor.withOpacity(0.20),
+ borderColor: AppColors.bgGreenColor.withOpacity(0.0),
+ textColor: AppColors.bgGreenColor,
+ fontSize: 14,
+ fontWeight: FontWeight.w500,
+ borderRadius: 12,
+ padding: EdgeInsets.fromLTRB(10, 0, 10, 0),
+ height: 40.h,
+ ),
+ ],
+ ),
+ ),
+ ),
+ SizedBox(height: 10.h),
+ GridView(
+ gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 3, crossAxisSpacing: 13, mainAxisSpacing: 13),
+ physics: NeverScrollableScrollPhysics(),
+ padding: EdgeInsets.only(top: 12),
+ shrinkWrap: true,
+ children: [
+ MedicalFileCard(label: "Update Insurance", textColor: AppColors.blackColor, backgroundColor: AppColors.whiteColor, svgIcon: AppAssets.eye_result_icon),
+ MedicalFileCard(label: "Insurance Approvals", textColor: AppColors.blackColor, backgroundColor: AppColors.whiteColor, svgIcon: AppAssets.eye_result_icon),
+ MedicalFileCard(label: "My Invoices List", textColor: AppColors.blackColor, backgroundColor: AppColors.whiteColor, svgIcon: AppAssets.eye_result_icon),
+ MedicalFileCard(label: "Ancillary Orders List", textColor: AppColors.blackColor, backgroundColor: AppColors.whiteColor, svgIcon: AppAssets.eye_result_icon),
+ ],
+ ),
],
),
),
diff --git a/lib/presentation/medical_file/widgets/medical_file_card.dart b/lib/presentation/medical_file/widgets/medical_file_card.dart
new file mode 100644
index 0000000..92bb4ee
--- /dev/null
+++ b/lib/presentation/medical_file/widgets/medical_file_card.dart
@@ -0,0 +1,44 @@
+import 'package:flutter/material.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/string_extensions.dart';
+import 'package:hmg_patient_app_new/extensions/widget_extensions.dart';
+
+class MedicalFileCard extends StatelessWidget {
+ final String label;
+
+ // final Color svgColor;
+ final Color textColor;
+ final Color backgroundColor;
+ final String svgIcon;
+
+ MedicalFileCard({
+ required this.label,
+ // required this.svgColor,
+ required this.textColor,
+ required this.backgroundColor,
+ this.svgIcon = "",
+ });
+
+ @override
+ Widget build(BuildContext context) {
+ return Container(
+ decoration: RoundedRectangleBorder().toSmoothCornerDecoration(
+ color: backgroundColor,
+ borderRadius: 20,
+ ),
+ child: Padding(
+ padding: EdgeInsets.all(8.h),
+ child: Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ mainAxisAlignment: MainAxisAlignment.center,
+ children: [
+ Utils.buildSvgWithAssets(icon: svgIcon, width: 30.h, height: 30.h, fit: BoxFit.contain),
+ SizedBox(height: 12.h),
+ label.toText11(color: textColor, isBold: true),
+ ],
+ ),
+ ),
+ );
+ }
+}
diff --git a/lib/providers/bottom_navigation_provider.dart b/lib/providers/bottom_navigation_provider.dart
deleted file mode 100644
index 58a0d4e..0000000
--- a/lib/providers/bottom_navigation_provider.dart
+++ /dev/null
@@ -1,12 +0,0 @@
-import 'package:flutter/material.dart';
-
-class BottomNavigationProvider extends ChangeNotifier {
- int _currentIndex = 0;
-
- int get currentIndex => _currentIndex;
-
- void setIndex(int index) {
- _currentIndex = index;
- notifyListeners();
- }
-}
\ No newline at end of file
diff --git a/lib/theme/colors.dart b/lib/theme/colors.dart
index 3aefebf..a395ba3 100644
--- a/lib/theme/colors.dart
+++ b/lib/theme/colors.dart
@@ -30,6 +30,7 @@ class AppColors {
static const Color textColor = Color(0xFF2E3039);
static const Color borderOnlyColor = Color(0xFF2E3039);
static const Color dividerColor = Color(0xFFD2D2D2);
+ static const Color warningColorYellow = Color(0xFFF4A308);
static const Color blackBgColor = Color(0xFF2E3039);
static const blackColor = textColor;
static const inputLabelTextColor = Color(0xff898A8D);