颜色判断

hmxc
张萌 3 years ago
parent 7eaa5b917e
commit f99caa685c

@ -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,

@ -135,12 +135,12 @@ class _OldAgeSupportPageSimpleState extends State<OldAgeSupportPageSimple> {
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<OldAgeSupportPageSimple> {
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<OldAgeSupportPageSimple> {
])
.size(56.sp)
.bold
.color(Colors.red)
.color(_model!.heartNormal ? Color(0xFF37C6BD) : Colors.red)
.make(),
Spacer(),
'正常为60-100次/分'

Loading…
Cancel
Save