Commit 505ab00892cf86a08a412361531c1a775502064b

Authored by 常守达
1 parent 46922705

fix(today):看板问题修复

... ... @@ -405,28 +405,33 @@ class TodayTabBody extends StatelessWidget {
Widget _buildWeekdayCell(BuildContext context, DateTime day) {
final selected = isSameDay(controller.selectedDate.value, day);
final isEnabled = !_isAfterToday(day);
return Center(
child: Container(
width: _selectedDayWidth,
height: _weekRowsHeight / 2,
alignment: Alignment.center,
decoration: selected
? BoxDecoration(
color: context.colors.primary,
borderRadius: const BorderRadius.vertical(
top: Radius.circular(22),
),
)
: null,
child: Text(
isSameDay(day, controller.lastSelectableDay)
? AppLocalizations.of(context)!.today
: _weekdayText(context, day),
style: TextStyle(
color: _calendarTextColor(context, day, selected: selected),
fontSize: 12,
fontWeight: FontWeight.w500,
return GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: isEnabled ? () => _onDaySelected(day, day) : null,
child: Center(
child: Container(
width: _selectedDayWidth,
height: _weekRowsHeight / 2,
alignment: Alignment.center,
decoration: selected
? BoxDecoration(
color: context.colors.primary,
borderRadius: const BorderRadius.vertical(
top: Radius.circular(22),
),
)
: null,
child: Text(
isSameDay(day, controller.lastSelectableDay)
? AppLocalizations.of(context)!.today
: _weekdayText(context, day),
style: TextStyle(
color: _calendarTextColor(context, day, selected: selected),
fontSize: 12,
fontWeight: FontWeight.w500,
),
),
),
),
... ... @@ -438,25 +443,31 @@ class TodayTabBody extends StatelessWidget {
DateTime day, {
bool selected = false,
}) {
return Center(
child: Container(
width: _selectedDayWidth,
height: _weekRowsHeight / 2,
alignment: Alignment.center,
decoration: selected
? BoxDecoration(
color: context.colors.primary,
borderRadius: const BorderRadius.vertical(
bottom: Radius.circular(22),
),
)
: null,
child: Text(
'${day.day}',
style: TextStyle(
color: _calendarTextColor(context, day, selected: selected),
fontSize: 12,
fontWeight: FontWeight.w500,
final isEnabled = !_isAfterToday(day);
return GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: isEnabled ? () => _onDaySelected(day, day) : null,
child: Center(
child: Container(
width: _selectedDayWidth,
height: _weekRowsHeight / 2,
alignment: Alignment.center,
decoration: selected
? BoxDecoration(
color: context.colors.primary,
borderRadius: const BorderRadius.vertical(
bottom: Radius.circular(22),
),
)
: null,
child: Text(
'${day.day}',
style: TextStyle(
color: _calendarTextColor(context, day, selected: selected),
fontSize: 12,
fontWeight: FontWeight.w500,
),
),
),
),
... ... @@ -480,7 +491,12 @@ class TodayTabBody extends StatelessWidget {
if (isSameDay(selectedDay, today.subtract(const Duration(days: 2)))) {
return '前天';
}
return MaterialLocalizations.of(context).formatShortMonthDay(selectedDay);
final locale = Localizations.localeOf(context).toString();
if (selectedDay.year == today.year) {
return DateFormat.Md(locale).format(selectedDay);
} else {
return DateFormat.yMd(locale).format(selectedDay);
}
}
bool _isAfterToday(DateTime day) {
... ...
import 'package:doublefeel_flutter/app/routes/app_pages.dart';
import 'package:doublefeel_flutter/core/theme/app_theme.dart';
import 'package:doublefeel_flutter/l10n/l10n_extensions.dart';
import 'package:flutter/material.dart';
... ... @@ -247,12 +248,19 @@ class _ContactText extends StatelessWidget {
),
children: [
TextSpan(text: l10n.todayFaqContactPrefix),
TextSpan(
text: l10n.todayFaqContactAction,
style: TextStyle(
color: context.colors.primary,
fontWeight: FontWeight.w600,
decoration: TextDecoration.underline,
WidgetSpan(
child: GestureDetector(
onTap: () {
Get.toNamed(Routes.SUBMIT_FEEDBACK);
},
child: Text(
l10n.todayFaqContactAction,
style: TextStyle(
color: context.colors.primary,
fontWeight: FontWeight.w600,
decoration: TextDecoration.underline,
),
),
),
),
TextSpan(text: l10n.todayFaqContactSuffix),
... ...
... ... @@ -19,33 +19,38 @@ class TodayHrvNumberCard extends StatelessWidget {
color: Colors.white,
borderRadius: BorderRadius.circular(16),
),
child: Obx(() => Row(
children: [
// HRV
Expanded(
child: _NumberItem(
label: controller.isFriend
? 'Ta今日的平均HRV'
: context.l10n.averageHrvForTheDay,
value:
controller.v2HealthData.value?.hrvAvg?.toString() ?? '--',
unit: 'ms',
),
child: Obx(() {
var sameDay = DateUtils.isSameDay(
controller.selectedDate.value, controller.lastSelectableDay);
return Row(
children: [
// HRV
Expanded(
child: _NumberItem(
label: controller.isFriend
? (sameDay ? 'Ta的今日平均HRV' : 'Ta的该日平均HRV')
: (sameDay ? '今日HRV趋势' : context.l10n.averageHrvForTheDay),
value:
controller.v2HealthData.value?.hrvAvg?.toString() ?? '--',
unit: 'ms',
),
),
Expanded(
child: _NumberItem(
label: controller.isFriend
? 'Ta的静息心率'
: context.l10n.restingHeartRate,
value: controller.v2HealthData.value?.lastRestingHrValue
?.toString() ??
'--',
unit: 'bpm',
),
Expanded(
child: _NumberItem(
label: controller.isFriend
? 'Ta的静息心率'
: context.l10n.restingHeartRate,
value: controller.v2HealthData.value?.lastRestingHrValue
?.toString() ??
'--',
unit: 'bpm',
),
],
)),
),
],
);
}),
);
}
}
... ...
import 'package:doublefeel_flutter/app/modules/membership_offer/controllers/membership_offer_controller.dart';
import 'package:doublefeel_flutter/app/routes/app_pages.dart';
import 'package:doublefeel_flutter/core/services/user_state_service.dart';
import 'package:doublefeel_flutter/core/theme/app_theme.dart';
import 'package:doublefeel_flutter/data/local/user_preferences_storage.dart';
import 'package:doublefeel_flutter/data/models/pay/pay_models.dart';
import 'package:doublefeel_flutter/l10n/l10n_extensions.dart';
import 'package:doublefeel_flutter/pigeon/platform_api.g.dart';
... ... @@ -41,7 +39,9 @@ class MembershipOfferView extends GetView<MembershipOfferController> {
),
child: Stack(
children: [
Lottie.asset('assets/lottie/scatter_flowers.json'),
IgnorePointer(
child: Lottie.asset('assets/lottie/scatter_flowers.json'),
),
Column(
mainAxisSize: MainAxisSize.max,
children: [
... ... @@ -106,20 +106,27 @@ class MembershipOfferView extends GetView<MembershipOfferController> {
],
);
}),
const SizedBox(height: 70),
const SizedBox(height: 58),
GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
Get.offNamed(Routes.PURCHASE);
},
child: Text(
l10n.onboardingMemberAllOptions,
textAlign: TextAlign.center,
style: TextStyle(
color: context.colors.textPrimary,
fontSize: 12,
decoration: TextDecoration.underline,
decorationColor: context.colors.textPrimary,
letterSpacing: 0,
child: Padding(
padding: const EdgeInsets.symmetric(
vertical: 12,
horizontal: 24,
),
child: Text(
l10n.onboardingMemberAllOptions,
textAlign: TextAlign.center,
style: TextStyle(
color: context.colors.textPrimary,
fontSize: 12,
decoration: TextDecoration.underline,
decorationColor: context.colors.textPrimary,
letterSpacing: 0,
),
),
),
),
... ...
... ... @@ -62,7 +62,9 @@ class PremiumActivatedView extends GetView<PremiumActivatedController> {
Widget _buildContentView(BuildContext context) {
return Stack(
children: [
Lottie.asset('assets/lottie/scatter_flowers.json'),
IgnorePointer(
child: Lottie.asset('assets/lottie/scatter_flowers.json'),
),
Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center,
... ...
... ... @@ -187,11 +187,11 @@ class V2HealthData {
sleepStateStr() {
switch (sleepState) {
case 1:
return '睡得很棒';
return '优秀';
case 2:
return '睡得不错';
return '正常';
case 3:
return '睡得差';
return '注意';
}
return '--';
}
... ...
... ... @@ -305,7 +305,7 @@
"todayFaqWatchFaceDelayRestartWatch": "· 若仍未自动刷新,请重启手表。长时间运行或后台占用过高可能导致表盘暂停更新。",
"todayFaqWatchFaceBlackScreenTitle": "手表表盘出现黑屏?",
"todayFaqWatchFaceBlackScreenDescription": "若添加专属互动表盘后出现黑屏(仅显示时间和日期),可长按表盘,点击「编辑」,左滑至「复杂功能」,选择 DoubleFeel,然后按需选择各组件重新添加。",
"today": "今",
"today": "今",
"yesterday": "昨天",
"backToToday": "回今天",
"redeemOffer": "领取优惠",
... ...
... ... @@ -1434,7 +1434,7 @@ abstract class AppLocalizations {
/// No description provided for @today.
///
/// In zh, this message translates to:
/// **'今'**
/// **'今'**
String get today;
/// No description provided for @yesterday.
... ...
... ... @@ -733,7 +733,7 @@ class AppLocalizationsZh extends AppLocalizations {
'若添加专属互动表盘后出现黑屏(仅显示时间和日期),可长按表盘,点击「编辑」,左滑至「复杂功能」,选择 DoubleFeel,然后按需选择各组件重新添加。';
@override
String get today => '今';
String get today => '今';
@override
String get yesterday => '昨天';
... ...