diff --git a/lib/models/bracelet/bracelet_model.dart b/lib/models/bracelet/bracelet_model.dart index f51660d2..052aab2d 100644 --- a/lib/models/bracelet/bracelet_model.dart +++ b/lib/models/bracelet/bracelet_model.dart @@ -33,6 +33,12 @@ class BraceletModel { } } + bool get heartNormal => heartRate >= 60 && heartRate <= 100; + + bool get sbpNormal => sbp >= 90 && sbp <= 139; + + bool get dbpNormal => dbp >= 60 && dbp <= 89; + const BraceletModel({ required this.sbp, required this.todaySteps, diff --git a/lib/pages/services/old_age/old_age_support_page_simple.dart b/lib/pages/services/old_age/old_age_support_page_simple.dart index b5b5c071..a9c9752a 100644 --- a/lib/pages/services/old_age/old_age_support_page_simple.dart +++ b/lib/pages/services/old_age/old_age_support_page_simple.dart @@ -135,12 +135,12 @@ class _OldAgeSupportPageSimpleState extends State { var mid = Row( crossAxisAlignment: CrossAxisAlignment.start, children: [ - '141' + '${_model?.sbp}' .richText .withTextSpanChildren([]) .size(48.sp) .bold - .color(Colors.red) + .color(_model!.sbpNormal ? Color(0xFF37C6BD) : Colors.red) .make(), 8.w.widthBox, Column( @@ -167,12 +167,12 @@ class _OldAgeSupportPageSimpleState extends State { var right = Row( crossAxisAlignment: CrossAxisAlignment.start, children: [ - '86' + '${_model?.dbp}' .richText .withTextSpanChildren([]) .size(48.sp) .bold - .color(Color(0xFF37C6BD)) + .color(_model!.dbpNormal ? Color(0xFF37C6BD) : Colors.red) .make(), 8.w.widthBox, Column( @@ -252,7 +252,7 @@ class _OldAgeSupportPageSimpleState extends State { ]) .size(56.sp) .bold - .color(Colors.red) + .color(_model!.heartNormal ? Color(0xFF37C6BD) : Colors.red) .make(), Spacer(), '正常为60-100次/分'