import 'dart:io';

import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:health/health.dart';
import 'package:hmg_patient_app_new/extensions/string_extensions.dart';
import 'package:hmg_patient_app_new/generated/locale_keys.g.dart';
import 'package:hmg_patient_app_new/theme/colors.dart';

class HealthMetricInfo {
  final HealthDataType type;
  final String nameEn;
  final String nameAr;
  final String unit;
  final Color color;
  final IconData icon;
  final String description;
  final double minHealthyValue;
  final double maxHealthyValue;
  final String svgIcon;

  const HealthMetricInfo(
      {required this.type,
      required this.nameEn,
      required this.nameAr,
      required this.unit,
      required this.color,
      required this.icon,
      required this.description,
      required this.minHealthyValue,
      required this.maxHealthyValue,
      required this.svgIcon});
}

class HealthMetrics {
  static final metrics = [
    HealthMetricInfo(
        type: HealthDataType.HEART_RATE,
        nameEn: "Heart Rate",
        nameAr: "معدل النبض",
        unit: 'BPM',
        color: AppColors.primaryRedColor,
        icon: Icons.favorite,
        description: LocaleKeys.heartRateDescription.tr(),
        minHealthyValue: 60,
        maxHealthyValue: 100,
        svgIcon: "assets/images/smartwatches/heartrate_icon.svg"),
    HealthMetricInfo(
        type: HealthDataType.BLOOD_OXYGEN,
        nameEn: "Blood Oxygen",
        nameAr: "أكسجين الدم",
        unit: '%',
        // color: Colors.blue,
        color: Color(0xff3A3558),
        icon: Icons.air,
        description: LocaleKeys.bloodOxygenDescription.tr(),
        minHealthyValue: 95,
        maxHealthyValue: 100,
        svgIcon: "assets/images/smartwatches/bloodoxygen_icon.svg"),
    HealthMetricInfo(
        type: HealthDataType.STEPS,
        nameEn: "Steps",
        nameAr: "خطوات",
        unit: 'steps',
        // color: Colors.green,
        color: Color(0xff3263B8),
        icon: Icons.directions_walk,
        description: "Number of steps taken throughout the day".needTranslation,
        minHealthyValue: 7000,
        maxHealthyValue: 15000,
        svgIcon: "assets/images/smartwatches/steps_icon.svg"),
    HealthMetricInfo(
        type: Platform.isIOS ? HealthDataType.ACTIVE_ENERGY_BURNED : HealthDataType.TOTAL_CALORIES_BURNED,
        nameEn: "Active Calories",
        nameAr: "السعرات الحرارية النشطة",
        unit: 'kcal',
        color: Color(0xffD59E95),
        icon: Icons.local_fire_department,
        description: "Calories burned during physical activity".needTranslation,
        minHealthyValue: 300,
        maxHealthyValue: 1000,
        svgIcon: "assets/images/smartwatches/calories_icon.svg"),
    HealthMetricInfo(
        type: Platform.isIOS ? HealthDataType.DISTANCE_WALKING_RUNNING : HealthDataType.DISTANCE_DELTA,
        nameEn: "Distance Covered",
        nameAr: "المسافة المغطاة",
        unit: 'KMs',
        // color: mainPurple,
        color: Color(0xff6A46F5),
        icon: Icons.directions_run,
        description: "Distance covered throughout the day".needTranslation,
        minHealthyValue: 3,
        maxHealthyValue: 10,
        svgIcon: "assets/images/smartwatches/distance_icon.svg"),
    // Add more metrics as needed
  ];
}
