Commit 965047dd7d91da4d011b211035c30459cb848acc

Authored by 常守达
1 parent a6814ded

fix(ui): 看板问题修复

... ... @@ -258,11 +258,11 @@ class TodayController extends GetMaterialController {
void changeDate(DateTime date, {DateTime? focused}) {
final normalizedDate = _clampDate(date);
if (!DateUtils.isSameDay(date, lastSelectableDay.value) &&
!_userStateService.isVip) {
toPremiumPage('今日-查看非当日数据');
return;
}
// if (!DateUtils.isSameDay(date, lastSelectableDay.value) &&
// !_userStateService.isVip) {
// toPremiumPage('今日-查看非当日数据');
// return;
// }
selectedDate.value = normalizedDate;
focusedDay.value = _clampDate(focused ?? normalizedDate);
}
... ...
... ... @@ -33,63 +33,70 @@ class HrvMeasurementBottomSheet extends StatelessWidget {
),
child: SafeArea(
top: false,
child: Column(
child: Stack(
children: [
SizedBox(
height: 64,
child: Stack(
alignment: Alignment.center,
children: [
Positioned(
left: 16,
child: GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: Get.back,
child: SizedBox(
width: 44,
height: 44,
child: Center(
child: Image.asset(
'assets/images/common/ic_close.png',
width: 20,
height: 20,
color: context.colors.chartPurple,
),
),
),
),
),
],
Container(
margin: EdgeInsets.only(
left: 16,
right: 16,
),
),
Expanded(
child: Container(
margin: EdgeInsets.only(left: 16, right: 16),
padding: const EdgeInsets.only(top: 16, bottom: 32),
padding: const EdgeInsets.only(
top: 16,
bottom: 32,
),
child: SingleChildScrollView(
padding: EdgeInsets.only(top: 64, bottom: 48),
child: Center(
child: const _HrvInstructionCard(),
),
),
),
Container(
height: 48,
width: 280,
margin: const EdgeInsets.only(bottom: 20),
child: ElevatedButton(
onPressed: Get.back,
style: ElevatedButton.styleFrom(
backgroundColor: context.colors.primary,
foregroundColor: Colors.white,
elevation: 0,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(24),
Positioned(
height: 64,
left: 16,
child: GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: Get.back,
child: SizedBox(
width: 44,
height: 44,
child: Center(
child: Image.asset(
'assets/images/common/ic_close.png',
width: 20,
height: 20,
color: context.colors.chartPurple,
),
),
),
child: Text(
l10n.todayBottomSheetGotIt,
style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.w600,
),
),
Positioned(
bottom: 0,
left: 0,
right: 0,
child: Center(
child: Container(
height: 48,
width: 280,
margin: const EdgeInsets.only(bottom: 20),
child: ElevatedButton(
onPressed: Get.back,
style: ElevatedButton.styleFrom(
backgroundColor: context.colors.primary,
foregroundColor: Colors.white,
elevation: 0,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(24),
),
),
child: Text(
l10n.todayBottomSheetGotIt,
style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.w600,
),
),
),
),
),
... ...
import 'package:doublefeel_flutter/app/widget/circular_gradient_progress/combine.dart';
import 'package:doublefeel_flutter/core/config/app_environment_config.dart';
import 'package:doublefeel_flutter/core/theme/app_theme.dart';
import 'package:doublefeel_flutter/l10n/l10n_extensions.dart';
import 'package:flutter/material.dart';
... ... @@ -14,6 +15,8 @@ class TodaySleepCard extends StatelessWidget {
@override
Widget build(BuildContext context) {
final l10n = context.l10n;
final isGlobal =
controller.environmentConfig.region.value == AppRegion.global;
return GestureDetector(
onTap: controller.toTrendSleepPage,
child: Obx(() {
... ... @@ -62,9 +65,12 @@ class TodaySleepCard extends StatelessWidget {
),
children: [
if (sleepHours > 0) ...[
TextSpan(text: '$sleepHours'),
TextSpan(
text: l10n.reportUnitHour,
text: isGlobal
? '$sleepHours '
: '$sleepHours'),
TextSpan(
text: l10n.sleepDailyUnitHour,
style: TextStyle(
color: context.colors.textSecondary,
fontSize: 12,
... ... @@ -73,9 +79,12 @@ class TodaySleepCard extends StatelessWidget {
)
],
if (sleepMinutes > 0) ...[
TextSpan(text: '$sleepMinutes'),
TextSpan(
text: l10n.reportUnitMinute,
text: isGlobal
? '${sleepHours > 0 ? ' ' : ''}$sleepMinutes '
: '$sleepMinutes'),
TextSpan(
text: l10n.sleepDailyUnitMinute,
style: TextStyle(
color: context.colors.textSecondary,
fontSize: 12,
... ... @@ -120,7 +129,7 @@ class TodaySleepCard extends StatelessWidget {
children: [
TextSpan(text: sleepAverageHeartRate),
TextSpan(
text: 'bpm',
text: isGlobal ? ' bpm' : 'bpm',
style: TextStyle(
color: context.colors.textSecondary,
fontSize: 12,
... ... @@ -174,6 +183,8 @@ class TodayActivityCard extends StatelessWidget {
@override
Widget build(BuildContext context) {
final l10n = context.l10n;
final isGlobal =
controller.environmentConfig.region.value == AppRegion.global;
return GestureDetector(
onTap: controller.toTrendActivityPage,
child: Obx(() {
... ... @@ -184,7 +195,9 @@ class TodayActivityCard extends StatelessWidget {
var exercise = healthData?.exercise ?? 0;
var activityStr = (activity > 0 && (activityTarget?.move ?? 0) > 0)
? '$activity'
? isGlobal
? '$activity '
: '$activity'
: '-';
// exercise 单位为秒,转换为小时+分钟
Widget exerciseWidget;
... ... @@ -198,9 +211,10 @@ class TodayActivityCard extends StatelessWidget {
fontWeight: FontWeight.w600,
),
children: [
TextSpan(text: '$exTotalMinutes'),
TextSpan(
text: l10n.reportUnitMinute,
text: isGlobal ? '$exTotalMinutes ' : '$exTotalMinutes'),
TextSpan(
text: l10n.activityUnitMinute,
style: TextStyle(
color: context.colors.textSecondary,
fontSize: 12,
... ... @@ -236,9 +250,9 @@ class TodayActivityCard extends StatelessWidget {
fontWeight: FontWeight.w600,
),
children: [
TextSpan(text: '$stand'),
TextSpan(text: isGlobal ? '$stand ' : '$stand'),
TextSpan(
text: l10n.reportUnitHour,
text: l10n.activityUnitHour,
style: TextStyle(
color: context.colors.textSecondary,
fontSize: 12,
... ...