Commit 9c4410d26b0a50ff2353be16c05d203c8db9f9d0

Authored by 刘宏哲
1 parent ab7e1d33

feat(app): update ui

@@ -23,6 +23,14 @@ class HealthReportSubjectScope extends InheritedWidget { @@ -23,6 +23,14 @@ class HealthReportSubjectScope extends InheritedWidget {
23 : context.l10n.reportOtherTitle(title); 23 : context.l10n.reportOtherTitle(title);
24 } 24 }
25 25
  26 + static String waitingForData(BuildContext context) {
  27 + final scope =
  28 + context.dependOnInheritedWidgetOfExactType<HealthReportSubjectScope>();
  29 + return scope == null || scope.isSelf
  30 + ? context.l10n.reportWaitingForData
  31 + : context.l10n.reportWaitingForOtherData;
  32 + }
  33 +
26 @override 34 @override
27 bool updateShouldNotify(HealthReportSubjectScope oldWidget) { 35 bool updateShouldNotify(HealthReportSubjectScope oldWidget) {
28 return oldWidget.isSelf != isSelf; 36 return oldWidget.isSelf != isSelf;
@@ -176,11 +176,13 @@ class _DailyReportContent extends StatelessWidget { @@ -176,11 +176,13 @@ class _DailyReportContent extends StatelessWidget {
176 SleepQualityRing(report: report), 176 SleepQualityRing(report: report),
177 const SizedBox(height: 16), 177 const SizedBox(height: 16),
178 Text( 178 Text(
179 - HealthReportSubjectScope.titleOf(  
180 - context,  
181 - quality.reportText,  
182 - possessive: false,  
183 - ), 179 + quality == SleepQualityLevel.unknown
  180 + ? HealthReportSubjectScope.waitingForData(context)
  181 + : HealthReportSubjectScope.titleOf(
  182 + context,
  183 + quality.reportText,
  184 + possessive: false,
  185 + ),
184 textAlign: TextAlign.center, 186 textAlign: TextAlign.center,
185 style: TextStyle( 187 style: TextStyle(
186 color: Color(quality.qualityColorValue), 188 color: Color(quality.qualityColorValue),
@@ -296,6 +296,7 @@ @@ -296,6 +296,7 @@
296 "reportDatePickerMonthOption": "{month}", 296 "reportDatePickerMonthOption": "{month}",
297 "reportDatePickerDayOption": "{day}", 297 "reportDatePickerDayOption": "{day}",
298 "reportWaitingForData": "Waiting for data", 298 "reportWaitingForData": "Waiting for data",
  299 + "reportWaitingForOtherData": "Waiting for their data",
299 "reportNoData": "No data", 300 "reportNoData": "No data",
300 "reportNoDataToday": "No data for today", 301 "reportNoDataToday": "No data for today",
301 "reportUnitDay": "days", 302 "reportUnitDay": "days",
@@ -698,4 +699,4 @@ @@ -698,4 +699,4 @@
698 "feedbackSubmitSuccessMessage": "Thank you for your feedback. If further communication is needed, we will contact you via the email address you left as soon as possible. Please keep an eye on your inbox.", 699 "feedbackSubmitSuccessMessage": "Thank you for your feedback. If further communication is needed, we will contact you via the email address you left as soon as possible. Please keep an eye on your inbox.",
699 "feedbackSubmitSuccessConfirm": "OK", 700 "feedbackSubmitSuccessConfirm": "OK",
700 "frequentMovement": "Frequent movement" 701 "frequentMovement": "Frequent movement"
701 -}  
  702 +}
@@ -437,6 +437,7 @@ @@ -437,6 +437,7 @@
437 } 437 }
438 }, 438 },
439 "reportWaitingForData": "等待数据", 439 "reportWaitingForData": "等待数据",
  440 + "reportWaitingForOtherData": "等待Ta的数据",
440 "reportNoData": "暂无数据", 441 "reportNoData": "暂无数据",
441 "reportNoDataToday": "暂无本日数据", 442 "reportNoDataToday": "暂无本日数据",
442 "reportUnitDay": "天", 443 "reportUnitDay": "天",
@@ -782,7 +783,7 @@ @@ -782,7 +783,7 @@
782 "friendsWaitingForData": "等待数据", 783 "friendsWaitingForData": "等待数据",
783 "friendsSleepQuality": "睡眠质量", 784 "friendsSleepQuality": "睡眠质量",
784 "friendsTodaySteps": "今日步数", 785 "friendsTodaySteps": "今日步数",
785 - "friendsSleepQualityExcellent": "睡很棒", 786 + "friendsSleepQualityExcellent": "睡很棒",
786 "friendsSleepQualityNormal": "睡得不错", 787 "friendsSleepQualityNormal": "睡得不错",
787 "friendsSleepQualityAttention": "睡得差", 788 "friendsSleepQualityAttention": "睡得差",
788 "friendsRemove": "删除Ta", 789 "friendsRemove": "删除Ta",
@@ -1077,4 +1078,4 @@ @@ -1077,4 +1078,4 @@
1077 "feedbackSubmitSuccessMessage": "谢谢您的反馈。如需进一步沟通,我们会尽快通过您留下的邮箱地址与您联系,请留意查收邮件。", 1078 "feedbackSubmitSuccessMessage": "谢谢您的反馈。如需进一步沟通,我们会尽快通过您留下的邮箱地址与您联系,请留意查收邮件。",
1078 "feedbackSubmitSuccessConfirm": "好的", 1079 "feedbackSubmitSuccessConfirm": "好的",
1079 "frequentMovement": "频繁移动" 1080 "frequentMovement": "频繁移动"
1080 -}  
  1081 +}
@@ -1875,6 +1875,12 @@ abstract class AppLocalizations { @@ -1875,6 +1875,12 @@ abstract class AppLocalizations {
1875 /// **'等待数据'** 1875 /// **'等待数据'**
1876 String get reportWaitingForData; 1876 String get reportWaitingForData;
1877 1877
  1878 + /// No description provided for @reportWaitingForOtherData.
  1879 + ///
  1880 + /// In zh, this message translates to:
  1881 + /// **'等待Ta的数据'**
  1882 + String get reportWaitingForOtherData;
  1883 +
1878 /// No description provided for @reportNoData. 1884 /// No description provided for @reportNoData.
1879 /// 1885 ///
1880 /// In zh, this message translates to: 1886 /// In zh, this message translates to:
@@ -2664,7 +2670,7 @@ abstract class AppLocalizations { @@ -2664,7 +2670,7 @@ abstract class AppLocalizations {
2664 /// No description provided for @friendsSleepQualityExcellent. 2670 /// No description provided for @friendsSleepQualityExcellent.
2665 /// 2671 ///
2666 /// In zh, this message translates to: 2672 /// In zh, this message translates to:
2667 - /// **'睡很棒'** 2673 + /// **'睡很棒'**
2668 String get friendsSleepQualityExcellent; 2674 String get friendsSleepQualityExcellent;
2669 2675
2670 /// No description provided for @friendsSleepQualityNormal. 2676 /// No description provided for @friendsSleepQualityNormal.
@@ -1029,6 +1029,9 @@ class AppLocalizationsEn extends AppLocalizations { @@ -1029,6 +1029,9 @@ class AppLocalizationsEn extends AppLocalizations {
1029 String get reportWaitingForData => 'Waiting for data'; 1029 String get reportWaitingForData => 'Waiting for data';
1030 1030
1031 @override 1031 @override
  1032 + String get reportWaitingForOtherData => 'Waiting for their data';
  1033 +
  1034 + @override
1032 String get reportNoData => 'No data'; 1035 String get reportNoData => 'No data';
1033 1036
1034 @override 1037 @override
@@ -973,6 +973,9 @@ class AppLocalizationsZh extends AppLocalizations { @@ -973,6 +973,9 @@ class AppLocalizationsZh extends AppLocalizations {
973 String get reportWaitingForData => '等待数据'; 973 String get reportWaitingForData => '等待数据';
974 974
975 @override 975 @override
  976 + String get reportWaitingForOtherData => '等待Ta的数据';
  977 +
  978 + @override
976 String get reportNoData => '暂无数据'; 979 String get reportNoData => '暂无数据';
977 980
978 @override 981 @override
@@ -1423,7 +1426,7 @@ class AppLocalizationsZh extends AppLocalizations { @@ -1423,7 +1426,7 @@ class AppLocalizationsZh extends AppLocalizations {
1423 String get friendsTodaySteps => '今日步数'; 1426 String get friendsTodaySteps => '今日步数';
1424 1427
1425 @override 1428 @override
1426 - String get friendsSleepQualityExcellent => '睡很棒'; 1429 + String get friendsSleepQualityExcellent => '睡很棒';
1427 1430
1428 @override 1431 @override
1429 String get friendsSleepQualityNormal => '睡得不错'; 1432 String get friendsSleepQualityNormal => '睡得不错';