You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
148 lines
6.5 KiB
Dart
148 lines
6.5 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:hmg_patient_app_new/core/app_assets.dart';
|
|
import 'package:hmg_patient_app_new/core/app_export.dart';
|
|
import 'package:hmg_patient_app_new/core/dependencies.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/presentation/smartwatches/activity_detail.dart';
|
|
import 'package:hmg_patient_app_new/services/navigation_service.dart';
|
|
import 'package:hmg_patient_app_new/theme/colors.dart';
|
|
import 'package:hmg_patient_app_new/widgets/appbar/collapsing_list_view.dart';
|
|
|
|
class SmartWatchActivity extends StatelessWidget {
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Scaffold(
|
|
backgroundColor: AppColors.bgScaffoldColor,
|
|
body: CollapsingListView(
|
|
title: "All Health Data".needTranslation,
|
|
child: Column(
|
|
spacing: 16.h,
|
|
children: [
|
|
resultItem(
|
|
leadingIcon: AppAssets.watchActivity,
|
|
title: "Activity".needTranslation,
|
|
description: "Activity rings give you a quick visual reference of how active you are each day. ".needTranslation,
|
|
trailingIcon: AppAssets.watchActivityTrailing,
|
|
result: "21",
|
|
unitsOfMeasure: "Cal"
|
|
).onPress((){
|
|
getIt.get<NavigationService>().pushPage(page: ActivityDetails( selectedActivity: "Steps"));
|
|
}),
|
|
resultItem(
|
|
leadingIcon: AppAssets.watchSteps,
|
|
title: "Steps".needTranslation,
|
|
description: "Step count is the number of steps you take throughout the day.".needTranslation,
|
|
trailingIcon: AppAssets.watchStepsTrailing,
|
|
result: "21",
|
|
unitsOfMeasure: "Steps"
|
|
),
|
|
resultItem(
|
|
leadingIcon: AppAssets.watchSteps,
|
|
title: "Walking + Running Distance".needTranslation,
|
|
description: "This will show you the total distance you covered in a day".needTranslation,
|
|
trailingIcon: AppAssets.watchStepsTrailing,
|
|
result: "21",
|
|
unitsOfMeasure: "km"
|
|
),
|
|
resultItem(
|
|
leadingIcon: AppAssets.watchSleep,
|
|
title: "Sleep Score".needTranslation,
|
|
description: "This will keep track of how much hours you sleep in a day".needTranslation,
|
|
trailingIcon: AppAssets.watchSleepTrailing,
|
|
result: "21",
|
|
unitsOfMeasure: "hr",
|
|
resultSecondValue: "2",
|
|
unitOfSecondMeasure: "min"
|
|
),
|
|
resultItem(
|
|
leadingIcon: AppAssets.watchBmi,
|
|
title: "Body Mass Index".needTranslation,
|
|
description: "This will calculate your weight and height ratio to analyze the ".needTranslation,
|
|
trailingIcon: AppAssets.watchBmiTrailing,
|
|
result: "21",
|
|
unitsOfMeasure: "BMI"
|
|
),
|
|
resultItem(
|
|
leadingIcon: AppAssets.watchWeight,
|
|
title: "Weight".needTranslation,
|
|
description: "This will calculate your weight to keep track and update history".needTranslation,
|
|
trailingIcon: AppAssets.watchWeightTrailing,
|
|
result: "21",
|
|
unitsOfMeasure: "Kg"
|
|
),
|
|
resultItem(
|
|
leadingIcon: AppAssets.watchWeight,
|
|
title: "Height".needTranslation,
|
|
description: "This will calculate your height to keep track and update history".needTranslation,
|
|
trailingIcon: AppAssets.watchWeightTrailing,
|
|
result: "21",
|
|
unitsOfMeasure: "ft"
|
|
)
|
|
],
|
|
).paddingSymmetrical(24.w, 24.h),
|
|
));
|
|
}
|
|
|
|
Widget resultItem({
|
|
required String leadingIcon,
|
|
required String title,
|
|
required String description,
|
|
required String trailingIcon,
|
|
required String result,
|
|
required String unitsOfMeasure,
|
|
String? resultSecondValue,
|
|
String? unitOfSecondMeasure
|
|
}) {
|
|
return DecoratedBox(
|
|
decoration: RoundedRectangleBorder().toSmoothCornerDecoration(color: AppColors.whiteColor, borderRadius: 12.h),
|
|
child: Row(
|
|
spacing: 16.w,
|
|
children: [
|
|
Expanded(
|
|
child:Column(
|
|
spacing: 8.h,
|
|
children: [
|
|
Row(
|
|
spacing: 8.w,
|
|
children: [
|
|
Utils.buildSvgWithAssets(icon: leadingIcon, height: 16.h, width: 14.w),
|
|
title.toText16( weight: FontWeight.w600, color: AppColors.textColor),
|
|
],
|
|
),
|
|
description.toText12(fontWeight: FontWeight.w500, color: AppColors.greyTextColor),
|
|
Row(
|
|
crossAxisAlignment: CrossAxisAlignment.baseline,
|
|
textBaseline: TextBaseline.alphabetic,
|
|
spacing: 2.h,
|
|
children: [
|
|
result.toText21(weight: FontWeight.w600, color: AppColors.textColor),
|
|
unitsOfMeasure.toText10(weight: FontWeight.w500, color:AppColors.greyTextColor ),
|
|
if(resultSecondValue != null)
|
|
Visibility(
|
|
visible: resultSecondValue != null ,
|
|
child: Row(
|
|
crossAxisAlignment: CrossAxisAlignment.baseline,
|
|
textBaseline: TextBaseline.alphabetic,
|
|
spacing: 2.h,
|
|
children: [
|
|
SizedBox(width: 2.w,),
|
|
resultSecondValue.toText21(weight: FontWeight.w600, color: AppColors.textColor),
|
|
unitOfSecondMeasure!.toText10(weight: FontWeight.w500, color:AppColors.greyTextColor )
|
|
],
|
|
),
|
|
)
|
|
],
|
|
),
|
|
|
|
],
|
|
) ,
|
|
),
|
|
Utils.buildSvgWithAssets(icon: trailingIcon, width: 72.w, height: 72.h),
|
|
],
|
|
).paddingSymmetrical(16.w, 16.h)
|
|
);
|
|
}
|
|
}
|