|
...
|
...
|
@@ -130,143 +130,135 @@ class TodayTabBody extends StatelessWidget { |
|
|
|
parent: ClampingScrollPhysics(),
|
|
|
|
),
|
|
|
|
slivers: [
|
|
|
|
SliverToBoxAdapter(
|
|
|
|
child: Container(
|
|
|
|
width: Get.width,
|
|
|
|
height: Get.width / 375 * (323 + pinnedHeaderHeight),
|
|
|
|
padding: EdgeInsets.only(bottom: 32),
|
|
|
|
child: Container(
|
|
|
|
// margin: EdgeInsets.only(top: pinnedHeaderHeight),
|
|
|
|
child: Column(
|
|
|
|
mainAxisAlignment: MainAxisAlignment.end,
|
|
|
|
children: [
|
|
|
|
Expanded(
|
|
|
|
child: Obx(() => Image.asset(
|
|
|
|
controller.v2StressScore.value?.stateBg() ??
|
|
|
|
'assets/images/today/bg_stress_state_0.png',
|
|
|
|
fit: BoxFit.cover,
|
|
|
|
width: Get.width,
|
|
|
|
height: Get.width / 375 * 345,
|
|
|
|
)),
|
|
|
|
),
|
|
|
|
Obx(
|
|
|
|
() => GestureDetector(
|
|
|
|
behavior: HitTestBehavior.opaque,
|
|
|
|
onTap: () {
|
|
|
|
showStressStatusExplanationBottomSheet(context);
|
|
|
|
},
|
|
|
|
child: Row(
|
|
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
children: [
|
|
|
|
Text(
|
|
|
|
'Hi,${controller.stressSubtitle.value}',
|
|
|
|
textAlign: TextAlign.center,
|
|
|
|
style: const TextStyle(
|
|
|
|
color: Color(0xFF78787D),
|
|
|
|
fontSize: 14,
|
|
|
|
fontWeight: FontWeight.w500,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
const SizedBox(width: 4),
|
|
|
|
Image.asset(
|
|
|
|
'assets/images/common/ic_info.png',
|
|
|
|
width: 14,
|
|
|
|
height: 14,
|
|
|
|
color: const Color(0xFF78787D),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
SliverList(
|
|
|
|
delegate: SliverChildListDelegate([
|
|
|
|
Obx(() => controller.isLoadingToday.value
|
|
|
|
? Container(
|
|
|
|
width: Get.width,
|
|
|
|
height: Get.width / 375 * 345,
|
|
|
|
child: Align(
|
|
|
|
alignment: Alignment(0.0, 0.5),
|
|
|
|
child: CircularProgressIndicator()),
|
|
|
|
)
|
|
|
|
: Image.asset(
|
|
|
|
controller.v2StressScore.value!.stateBg(),
|
|
|
|
fit: BoxFit.cover,
|
|
|
|
width: Get.width,
|
|
|
|
height: Get.width / 375 * 345,
|
|
|
|
)),
|
|
|
|
Obx(
|
|
|
|
() => GestureDetector(
|
|
|
|
behavior: HitTestBehavior.opaque,
|
|
|
|
onTap: () {
|
|
|
|
showStressStatusExplanationBottomSheet(context);
|
|
|
|
},
|
|
|
|
child: Row(
|
|
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
children: [
|
|
|
|
Text(
|
|
|
|
'Hi,${controller.stressSubtitle.value}',
|
|
|
|
textAlign: TextAlign.center,
|
|
|
|
style: const TextStyle(
|
|
|
|
color: Color(0xFF78787D),
|
|
|
|
fontSize: 14,
|
|
|
|
fontWeight: FontWeight.w500,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Container(
|
|
|
|
height: 51,
|
|
|
|
alignment: Alignment.topCenter,
|
|
|
|
child: Obx(
|
|
|
|
() => controller.isLoadingToday.value
|
|
|
|
? CircularProgressIndicator(strokeWidth: 2.5)
|
|
|
|
: Text(
|
|
|
|
controller.v2StressScore.value?.stateString() ??
|
|
|
|
'',
|
|
|
|
textAlign: TextAlign.center,
|
|
|
|
style: TextStyle(
|
|
|
|
color: context.colors.textPrimary,
|
|
|
|
fontSize: 28,
|
|
|
|
fontWeight: FontWeight.w500,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
const SizedBox(width: 4),
|
|
|
|
Image.asset(
|
|
|
|
'assets/images/common/ic_info.png',
|
|
|
|
width: 14,
|
|
|
|
height: 14,
|
|
|
|
color: const Color(0xFF78787D),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Obx(() => controller.isLoadingToday.value
|
|
|
|
? SizedBox()
|
|
|
|
: Text(
|
|
|
|
controller.v2StressScore.value?.stateString() ?? '',
|
|
|
|
textAlign: TextAlign.center,
|
|
|
|
style: TextStyle(
|
|
|
|
color: context.colors.textPrimary,
|
|
|
|
fontSize: 28,
|
|
|
|
fontWeight: FontWeight.w500,
|
|
|
|
),
|
|
|
|
)),
|
|
|
|
Center(
|
|
|
|
child: Obx(
|
|
|
|
() => StressProgressBar(
|
|
|
|
score: controller.v2StressScore.value?.state == 0
|
|
|
|
? null
|
|
|
|
: controller.v2StressScore.value?.comprehensiveScore,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
SizedBox(
|
|
|
|
height: 36,
|
|
|
|
),
|
|
|
|
Padding(
|
|
|
|
padding: const EdgeInsets.symmetric(horizontal: 16.0),
|
|
|
|
child: Column(
|
|
|
|
children: [
|
|
|
|
Obx(
|
|
|
|
() => StressProgressBar(
|
|
|
|
score: controller.v2StressScore.value?.state == 0
|
|
|
|
? null
|
|
|
|
: controller.v2StressScore.value?.comprehensiveScore,
|
|
|
|
() => controller.showHealthDataAuthCardStatus.value != 1
|
|
|
|
? TodayHealthDataAuthCard(
|
|
|
|
onAuthorizeTap: () {
|
|
|
|
controller.onAuthorizeTap();
|
|
|
|
},
|
|
|
|
)
|
|
|
|
: const SizedBox.shrink(),
|
|
|
|
),
|
|
|
|
Obx(() {
|
|
|
|
return Get.find<UserStateService>().isVip
|
|
|
|
? const SizedBox.shrink()
|
|
|
|
: GestureDetector(
|
|
|
|
onTap: () {
|
|
|
|
ta.track('click_doublefeel_today_status',
|
|
|
|
properties: {'ita': '会员banner'});
|
|
|
|
controller.toPremiumDiscoutPage('今日-会员广告');
|
|
|
|
},
|
|
|
|
child: PremiumCard(
|
|
|
|
controller,
|
|
|
|
));
|
|
|
|
}),
|
|
|
|
TodayAdCarousel(controller: controller),
|
|
|
|
TodayHrvNumberCard(controller: controller),
|
|
|
|
const SizedBox(height: 12),
|
|
|
|
TodayHrvChartCard(controller: controller),
|
|
|
|
const SizedBox(height: 12),
|
|
|
|
_LatestHrvCard(controller: controller),
|
|
|
|
if (!controller.isFriend) measureHRVButton(context),
|
|
|
|
Padding(
|
|
|
|
padding: const EdgeInsets.symmetric(vertical: 12),
|
|
|
|
child: Text(
|
|
|
|
(controller.isFriend
|
|
|
|
? context.l10n.reportOtherPossessiveTitle(
|
|
|
|
context.l10n.dailyActions)
|
|
|
|
: context.l10n.dailyActions),
|
|
|
|
style: TextStyle(
|
|
|
|
color: context.colors.textPrimary,
|
|
|
|
fontSize: 16,
|
|
|
|
fontWeight: FontWeight.w600,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
TodaySleepCard(controller: controller),
|
|
|
|
TodayActivityCard(controller: controller),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
SliverPadding(
|
|
|
|
padding: const EdgeInsets.symmetric(horizontal: 16),
|
|
|
|
sliver: SliverList(
|
|
|
|
delegate: SliverChildListDelegate([
|
|
|
|
Obx(
|
|
|
|
() => controller.showHealthDataAuthCardStatus.value != 1
|
|
|
|
? TodayHealthDataAuthCard(
|
|
|
|
onAuthorizeTap: () {
|
|
|
|
controller.onAuthorizeTap();
|
|
|
|
},
|
|
|
|
)
|
|
|
|
: const SizedBox.shrink(),
|
|
|
|
),
|
|
|
|
Obx(() {
|
|
|
|
return Get.find<UserStateService>().isVip
|
|
|
|
? const SizedBox.shrink()
|
|
|
|
: GestureDetector(
|
|
|
|
onTap: () {
|
|
|
|
ta.track('click_doublefeel_today_status',
|
|
|
|
properties: {'ita': '会员banner'});
|
|
|
|
controller.toPremiumDiscoutPage('今日-会员广告');
|
|
|
|
},
|
|
|
|
child: PremiumCard(
|
|
|
|
controller,
|
|
|
|
));
|
|
|
|
}),
|
|
|
|
TodayAdCarousel(controller: controller),
|
|
|
|
TodayHrvNumberCard(controller: controller),
|
|
|
|
const SizedBox(height: 12),
|
|
|
|
TodayHrvChartCard(controller: controller),
|
|
|
|
const SizedBox(height: 12),
|
|
|
|
_LatestHrvCard(controller: controller),
|
|
|
|
if (!controller.isFriend) measureHRVButton(context),
|
|
|
|
Padding(
|
|
|
|
padding: const EdgeInsets.symmetric(vertical: 12),
|
|
|
|
child: Text(
|
|
|
|
(controller.isFriend
|
|
|
|
? context.l10n
|
|
|
|
.reportOtherPossessiveTitle(context.l10n.dailyActions)
|
|
|
|
: context.l10n.dailyActions),
|
|
|
|
style: TextStyle(
|
|
|
|
color: context.colors.textPrimary,
|
|
|
|
fontSize: 16,
|
|
|
|
fontWeight: FontWeight.w600,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
TodaySleepCard(controller: controller),
|
|
|
|
TodayActivityCard(controller: controller),
|
|
|
|
Container(
|
|
|
|
alignment: Alignment.center,
|
|
|
|
margin: EdgeInsets.only(
|
|
|
|
bottom: 16,
|
|
|
|
// top: 28,
|
|
|
|
),
|
|
|
|
child: ReportBottomSlogan(),
|
|
|
|
Container(
|
|
|
|
alignment: Alignment.center,
|
|
|
|
margin: EdgeInsets.only(
|
|
|
|
bottom: 16,
|
|
|
|
// top: 28,
|
|
|
|
),
|
|
|
|
]),
|
|
|
|
),
|
|
|
|
child: ReportBottomSlogan(),
|
|
|
|
),
|
|
|
|
]),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
);
|
...
|
...
|
|