diff --git a/assets/images/png/smartwatches/Apple-Watch-6.png b/assets/images/png/smartwatches/Apple-Watch-6.png
new file mode 100644
index 0000000..1e67050
Binary files /dev/null and b/assets/images/png/smartwatches/Apple-Watch-6.png differ
diff --git a/assets/images/png/smartwatches/apple-watch-1.jpeg b/assets/images/png/smartwatches/apple-watch-1.jpeg
new file mode 100644
index 0000000..7262e7e
Binary files /dev/null and b/assets/images/png/smartwatches/apple-watch-1.jpeg differ
diff --git a/assets/images/png/smartwatches/apple-watch-2.jpg b/assets/images/png/smartwatches/apple-watch-2.jpg
new file mode 100644
index 0000000..f688f74
Binary files /dev/null and b/assets/images/png/smartwatches/apple-watch-2.jpg differ
diff --git a/assets/images/png/smartwatches/apple-watch-3.jpg b/assets/images/png/smartwatches/apple-watch-3.jpg
new file mode 100644
index 0000000..b68c1ce
Binary files /dev/null and b/assets/images/png/smartwatches/apple-watch-3.jpg differ
diff --git a/assets/images/png/smartwatches/apple-watch-4.jpg b/assets/images/png/smartwatches/apple-watch-4.jpg
new file mode 100644
index 0000000..2fc19b6
Binary files /dev/null and b/assets/images/png/smartwatches/apple-watch-4.jpg differ
diff --git a/assets/images/png/smartwatches/apple-watch-5.jpg b/assets/images/png/smartwatches/apple-watch-5.jpg
new file mode 100644
index 0000000..4c497ea
Binary files /dev/null and b/assets/images/png/smartwatches/apple-watch-5.jpg differ
diff --git a/assets/images/png/smartwatches/bloodoxygen_icon.svg b/assets/images/png/smartwatches/bloodoxygen_icon.svg
new file mode 100644
index 0000000..0971a30
--- /dev/null
+++ b/assets/images/png/smartwatches/bloodoxygen_icon.svg
@@ -0,0 +1,5 @@
+
diff --git a/assets/images/png/smartwatches/calories_icon.svg b/assets/images/png/smartwatches/calories_icon.svg
new file mode 100644
index 0000000..660ce0d
--- /dev/null
+++ b/assets/images/png/smartwatches/calories_icon.svg
@@ -0,0 +1,3 @@
+
diff --git a/assets/images/png/smartwatches/distance_icon.svg b/assets/images/png/smartwatches/distance_icon.svg
new file mode 100644
index 0000000..29dcf3d
--- /dev/null
+++ b/assets/images/png/smartwatches/distance_icon.svg
@@ -0,0 +1,3 @@
+
diff --git a/assets/images/png/smartwatches/galaxy_fit_3.jpg b/assets/images/png/smartwatches/galaxy_fit_3.jpg
new file mode 100644
index 0000000..ff05834
Binary files /dev/null and b/assets/images/png/smartwatches/galaxy_fit_3.jpg differ
diff --git a/assets/images/png/smartwatches/galaxy_watch_7.webp b/assets/images/png/smartwatches/galaxy_watch_7.webp
new file mode 100644
index 0000000..09748b4
Binary files /dev/null and b/assets/images/png/smartwatches/galaxy_watch_7.webp differ
diff --git a/assets/images/png/smartwatches/galaxy_watch_7_classic.jpg b/assets/images/png/smartwatches/galaxy_watch_7_classic.jpg
new file mode 100644
index 0000000..f177dd4
Binary files /dev/null and b/assets/images/png/smartwatches/galaxy_watch_7_classic.jpg differ
diff --git a/assets/images/png/smartwatches/galaxy_watch_8.jpg b/assets/images/png/smartwatches/galaxy_watch_8.jpg
new file mode 100644
index 0000000..7fd4746
Binary files /dev/null and b/assets/images/png/smartwatches/galaxy_watch_8.jpg differ
diff --git a/assets/images/png/smartwatches/galaxy_watch_8_classic.jpeg b/assets/images/png/smartwatches/galaxy_watch_8_classic.jpeg
new file mode 100644
index 0000000..6e84096
Binary files /dev/null and b/assets/images/png/smartwatches/galaxy_watch_8_classic.jpeg differ
diff --git a/assets/images/png/smartwatches/galaxy_watch_ultra.jpg b/assets/images/png/smartwatches/galaxy_watch_ultra.jpg
new file mode 100644
index 0000000..e401d73
Binary files /dev/null and b/assets/images/png/smartwatches/galaxy_watch_ultra.jpg differ
diff --git a/assets/images/png/smartwatches/heartrate_icon.svg b/assets/images/png/smartwatches/heartrate_icon.svg
new file mode 100644
index 0000000..dac05ef
--- /dev/null
+++ b/assets/images/png/smartwatches/heartrate_icon.svg
@@ -0,0 +1,3 @@
+
diff --git a/assets/images/png/smartwatches/steps_icon.svg b/assets/images/png/smartwatches/steps_icon.svg
new file mode 100644
index 0000000..4af073a
--- /dev/null
+++ b/assets/images/png/smartwatches/steps_icon.svg
@@ -0,0 +1,4 @@
+
diff --git a/assets/images/svg/daily_water_monitor.svg b/assets/images/svg/daily_water_monitor.svg
new file mode 100644
index 0000000..b5f057d
--- /dev/null
+++ b/assets/images/svg/daily_water_monitor.svg
@@ -0,0 +1,5 @@
+
diff --git a/assets/images/svg/health_calculators_services_icon.svg b/assets/images/svg/health_calculators_services_icon.svg
new file mode 100644
index 0000000..9f30d08
--- /dev/null
+++ b/assets/images/svg/health_calculators_services_icon.svg
@@ -0,0 +1,3 @@
+
diff --git a/assets/images/svg/health_converters_icon.svg b/assets/images/svg/health_converters_icon.svg
new file mode 100644
index 0000000..225ad01
--- /dev/null
+++ b/assets/images/svg/health_converters_icon.svg
@@ -0,0 +1,4 @@
+
diff --git a/assets/images/svg/smartwatch_icon.svg b/assets/images/svg/smartwatch_icon.svg
new file mode 100644
index 0000000..162ab36
--- /dev/null
+++ b/assets/images/svg/smartwatch_icon.svg
@@ -0,0 +1,3 @@
+
diff --git a/ios/Runner/Info.plist b/ios/Runner/Info.plist
index 8f2ef94..ab9828e 100644
--- a/ios/Runner/Info.plist
+++ b/ios/Runner/Info.plist
@@ -71,6 +71,8 @@
This app requires contacts access to show incoming virtual consultation request.
NSFaceIDUsageDescription
This app requires Face ID to allow biometric authentication for app login.
+ NSHealthClinicalHealthRecordsShareUsageDescription
+ This App need access to HealthKit to read heart rate & other data from your smart watch.
NSHealthShareUsageDescription
This App need access to HealthKit to read heart rate & other data from your smart watch.
NSHealthUpdateUsageDescription
diff --git a/ios/Runner/Runner.entitlements b/ios/Runner/Runner.entitlements
index 319178a..2c37e77 100644
--- a/ios/Runner/Runner.entitlements
+++ b/ios/Runner/Runner.entitlements
@@ -4,6 +4,14 @@
aps-environment
development
+ com.apple.developer.healthkit
+
+ com.apple.developer.healthkit.access
+
+ health-records
+
+ com.apple.developer.healthkit.background-delivery
+
com.apple.developer.in-app-payments
merchant.com.hmgwebservices
diff --git a/lib/core/app_assets.dart b/lib/core/app_assets.dart
index f5d0fe5..aa8d26e 100644
--- a/lib/core/app_assets.dart
+++ b/lib/core/app_assets.dart
@@ -202,6 +202,10 @@ class AppAssets {
static const String insurance_approval_icon = '$svgBasePath/insurance_approval_icon.svg';
static const String invoices_list_icon = '$svgBasePath/invoices_list_icon.svg';
static const String ancillary_orders_list_icon = '$svgBasePath/ancillary_orders_list_icon.svg';
+ static const String daily_water_monitor_icon = '$svgBasePath/daily_water_monitor.svg';
+ static const String health_calculators_services_icon = '$svgBasePath/health_calculators_services_icon.svg';
+ static const String health_converters_icon = '$svgBasePath/health_converters_icon.svg';
+ static const String smartwatch_icon = '$svgBasePath/smartwatch_icon.svg';
//bottom navigation//
static const String homeBottom = '$svgBasePath/home_bottom.svg';
diff --git a/lib/core/dependencies.dart b/lib/core/dependencies.dart
index 4c17de6..054819e 100644
--- a/lib/core/dependencies.dart
+++ b/lib/core/dependencies.dart
@@ -39,6 +39,7 @@ import 'package:hmg_patient_app_new/features/prescriptions/prescriptions_view_mo
import 'package:hmg_patient_app_new/features/profile_settings/profile_settings_view_model.dart';
import 'package:hmg_patient_app_new/features/radiology/radiology_repo.dart';
import 'package:hmg_patient_app_new/features/radiology/radiology_view_model.dart';
+import 'package:hmg_patient_app_new/features/smartwatch_health_data/health_provider.dart';
import 'package:hmg_patient_app_new/features/symptoms_checker/symptoms_checker_repo.dart';
import 'package:hmg_patient_app_new/features/symptoms_checker/symptoms_checker_view_model.dart';
import 'package:hmg_patient_app_new/features/todo_section/todo_section_repo.dart';
@@ -232,6 +233,10 @@ class AppDependencies {
() => BloodDonationViewModel(bloodDonationRepo: getIt(), errorHandlerService: getIt(), navigationService: getIt(), dialogService: getIt(), appState: getIt()),
);
+ getIt.registerLazySingleton(
+ () => HealthProvider(),
+ );
+
// Screen-specific VMs → Factory
// getIt.registerFactory(
// () => BookAppointmentsViewModel(
diff --git a/lib/features/smartwatch_health_data/health_provider.dart b/lib/features/smartwatch_health_data/health_provider.dart
new file mode 100644
index 0000000..fc9dacc
--- /dev/null
+++ b/lib/features/smartwatch_health_data/health_provider.dart
@@ -0,0 +1,85 @@
+import 'package:flutter/foundation.dart';
+import 'package:health/health.dart';
+import 'package:hmg_patient_app_new/features/smartwatch_health_data/health_service.dart';
+
+class HealthProvider with ChangeNotifier {
+ final HealthService _healthService = HealthService();
+ Map> healthData = {};
+ bool isLoading = false;
+ String? error;
+ String selectedTimeRange = '7D';
+ int selectedTabIndex = 0;
+
+ void onTabChanged(int index) {
+ selectedTabIndex = index;
+ notifyListeners();
+ }
+
+ Future fetchHealthData() async {
+ isLoading = true;
+ error = null;
+ notifyListeners();
+ healthData.clear();
+ try {
+ final authorized = await _healthService.requestAuthorization();
+ if (!authorized) {
+ error = 'Health data access not authorized';
+ isLoading = false;
+ notifyListeners();
+ return;
+ }
+
+ final startTime = _getStartDate();
+ final endTime = DateTime.now();
+
+ healthData = await _healthService.getAllHealthData(startTime, endTime);
+
+ isLoading = false;
+ notifyListeners();
+ } catch (e) {
+ error = 'Error fetching health data: $e';
+ isLoading = false;
+ notifyListeners();
+ }
+ }
+
+ Future refreshMetric(HealthDataType type) async {
+ try {
+ final startTime = _getStartDate();
+ final endTime = DateTime.now();
+
+ final data = await _healthService.getSpecificHealthData(
+ type,
+ startTime,
+ endTime,
+ );
+
+ healthData[type] = data;
+ notifyListeners();
+ } catch (e) {
+ print('Error refreshing metric $type: $e');
+ }
+ }
+
+ void updateTimeRange(String range) {
+ selectedTimeRange = range;
+ fetchHealthData();
+ }
+
+ DateTime _getStartDate() {
+ switch (selectedTimeRange) {
+ case '1D':
+ return DateTime.now().subtract(const Duration(days: 1));
+ case '7D':
+ return DateTime.now().subtract(const Duration(days: 7));
+ case '1M':
+ return DateTime.now().subtract(const Duration(days: 30));
+ case '3M':
+ return DateTime.now().subtract(const Duration(days: 90));
+ case '1Y':
+ return DateTime.now().subtract(const Duration(days: 365));
+ default:
+ return DateTime.now().subtract(const Duration(days: 7));
+ }
+ }
+}
diff --git a/lib/features/smartwatch_health_data/health_service.dart b/lib/features/smartwatch_health_data/health_service.dart
new file mode 100644
index 0000000..c5dca48
--- /dev/null
+++ b/lib/features/smartwatch_health_data/health_service.dart
@@ -0,0 +1,166 @@
+import 'dart:io';
+
+import 'package:easy_localization/easy_localization.dart';
+import 'package:flutter/cupertino.dart';
+import 'package:health/health.dart';
+import 'package:permission_handler/permission_handler.dart';
+
+import 'health_utils.dart';
+
+class HealthService {
+ static final HealthService _instance = HealthService._internal();
+
+ factory HealthService() => _instance;
+
+ HealthService._internal();
+
+ final Health health = Health();
+
+ final List _healthMetrics = [
+ HealthDataType.HEART_RATE,
+ // HealthDataType.STEPS,
+ // HealthDataType.BLOOD_OXYGEN,
+ // HealthDataType.BLOOD_PRESSURE_SYSTOLIC,
+ // HealthDataType.BLOOD_PRESSURE_DIASTOLIC,
+ // HealthDataType.BODY_TEMPERATURE,
+ // HealthDataType.DISTANCE_WALKING_RUNNING,
+ // HealthDataType.ACTIVE_ENERGY_BURNED,
+ ];
+
+ final List _healthMetricsAndroid = [
+ HealthDataType.HEART_RATE,
+ HealthDataType.STEPS,
+ HealthDataType.BLOOD_OXYGEN,
+ // HealthDataType.BLOOD_PRESSURE_SYSTOLIC,
+ // HealthDataType.BLOOD_PRESSURE_DIASTOLIC,
+ // HealthDataType.BODY_TEMPERATURE,
+ HealthDataType.DISTANCE_DELTA,
+ HealthDataType.ACTIVE_ENERGY_BURNED,
+ HealthDataType.BASAL_ENERGY_BURNED,
+ HealthDataType.TOTAL_CALORIES_BURNED
+ ];
+
+ final List _healthPermissions = [
+ HealthDataType.HEART_RATE,
+ HealthDataType.STEPS,
+ HealthDataType.BLOOD_OXYGEN,
+ // HealthDataType.BLOOD_PRESSURE_SYSTOLIC,
+ // HealthDataType.BLOOD_PRESSURE_DIASTOLIC,
+ // HealthDataType.BODY_TEMPERATURE,
+ Platform.isAndroid ? HealthDataType.DISTANCE_DELTA : HealthDataType.DISTANCE_WALKING_RUNNING,
+ HealthDataType.ACTIVE_ENERGY_BURNED,
+ HealthDataType.BASAL_ENERGY_BURNED,
+ HealthDataType.TOTAL_CALORIES_BURNED
+ ];
+
+ final List _healthMetricsCumulative = [
+ HealthDataType.BLOOD_OXYGEN,
+ HealthDataType.STEPS,
+ Platform.isAndroid ? HealthDataType.DISTANCE_DELTA : HealthDataType.DISTANCE_WALKING_RUNNING,
+ HealthDataType.ACTIVE_ENERGY_BURNED,
+ HealthDataType.BASAL_ENERGY_BURNED,
+ HealthDataType.TOTAL_CALORIES_BURNED
+ ];
+
+ Future requestAuthorization() async {
+ try {
+ final types = (Platform.isAndroid) ? dataTypesAndroid : _healthPermissions;
+ final granted = await health.requestAuthorization(types);
+ await Permission.activityRecognition.request();
+ await Permission.location.request();
+ // request access to read historic data
+ await Health().requestHealthDataHistoryAuthorization();
+ // await authorize();
+ return granted;
+ } catch (e) {
+ print('Authorization error: $e');
+ return false;
+ }
+ }
+
+ Future