|
|
|
import 'package:cached_network_image/cached_network_image.dart';
|
|
|
|
|
|
|
|
import 'package:doublefeel_flutter/app/modules/home/widgets/today/hrv_measurement_bottom_sheet.dart';
|
|
|
|
import 'package:doublefeel_flutter/app/modules/home/widgets/today/no_health_data_page.dart';
|
|
|
|
import 'package:doublefeel_flutter/app/modules/report_common/models/report_period.dart';
|
|
|
|
import 'package:doublefeel_flutter/app/modules/report_common/widgets/report_date_picker_sheet.dart';
|
|
|
|
|
|
...
|
...
|
@@ -37,7 +36,6 @@ class TodayTabBody extends StatelessWidget { |
|
|
|
|
|
|
|
final TodayController controller;
|
|
|
|
|
|
|
|
final _bgColor = const Color(0xFFF2F2F7);
|
|
|
|
final _weekCalendarHeight = 58.0;
|
|
|
|
final _topContentHeight = /*_topBarHeight + _weekCalendarHeight*/ 106.0;
|
|
|
|
final _weekRowsHeight = 50.0;
|
|
...
|
...
|
@@ -49,7 +47,7 @@ class TodayTabBody extends StatelessWidget { |
|
|
|
final pinnedHeaderHeight = topPadding + _topContentHeight;
|
|
|
|
|
|
|
|
return Container(
|
|
|
|
color: _bgColor,
|
|
|
|
color: context.colors.backgroundPage,
|
|
|
|
child: Stack(
|
|
|
|
children: [
|
|
|
|
NotificationListener<ScrollNotification>(
|
|
...
|
...
|
@@ -73,9 +71,12 @@ class TodayTabBody extends StatelessWidget { |
|
|
|
.clamp(0.0, 1.0)
|
|
|
|
.toDouble();
|
|
|
|
|
|
|
|
return Container(
|
|
|
|
color: const Color(0xFFDDD2FF).withValues(alpha: opacity),
|
|
|
|
);
|
|
|
|
return Obx(() => Container(
|
|
|
|
color:
|
|
|
|
(controller.v2StressScore.value?.getBackgroundColor() ??
|
|
|
|
Color(0xFFE3E1EC))
|
|
|
|
.withValues(alpha: opacity),
|
|
|
|
));
|
|
|
|
}),
|
|
|
|
),
|
|
|
|
Positioned(
|
|
...
|
...
|
@@ -96,6 +97,9 @@ class TodayTabBody extends StatelessWidget { |
|
|
|
controller.lastSelectableDay,
|
|
|
|
),
|
|
|
|
onBackToToday: _backToToday,
|
|
|
|
onTapPremiumCard: () {
|
|
|
|
controller.toPremiumPage();
|
|
|
|
},
|
|
|
|
),
|
|
|
|
_buildWeekCalendar(context),
|
|
|
|
],
|
|
...
|
...
|
@@ -118,21 +122,38 @@ class TodayTabBody extends StatelessWidget { |
|
|
|
child: Container(
|
|
|
|
height: 323 + pinnedHeaderHeight,
|
|
|
|
padding: EdgeInsets.only(bottom: 32),
|
|
|
|
decoration: const BoxDecoration(
|
|
|
|
gradient: LinearGradient(
|
|
|
|
begin: Alignment.topCenter,
|
|
|
|
end: Alignment.bottomCenter,
|
|
|
|
colors: [
|
|
|
|
Color(0xFFC5B0FF),
|
|
|
|
Color(0xFFF5F2FF),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
// decoration: const BoxDecoration(
|
|
|
|
// gradient: LinearGradient(
|
|
|
|
// begin: Alignment.topCenter,
|
|
|
|
// end: Alignment.bottomCenter,
|
|
|
|
// colors: [
|
|
|
|
// Color(0xFFC5B0FF),
|
|
|
|
// Color(0xFFF5F2FF),
|
|
|
|
// ],
|
|
|
|
// ),
|
|
|
|
// ),
|
|
|
|
// decoration: BoxDecoration(
|
|
|
|
// image: DecorationImage(
|
|
|
|
// image: AssetImage(
|
|
|
|
// controller.v2StressScore.value?.stateBg() ??
|
|
|
|
// 'assets/images/today/bg_stress_state_0.png',
|
|
|
|
// ),
|
|
|
|
// fit: BoxFit.cover,
|
|
|
|
// alignment: Alignment.topCenter,
|
|
|
|
// ),
|
|
|
|
// ),
|
|
|
|
child: Container(
|
|
|
|
margin: EdgeInsets.only(top: pinnedHeaderHeight),
|
|
|
|
// 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.fitHeight,
|
|
|
|
)),
|
|
|
|
),
|
|
|
|
Obx(
|
|
|
|
() => GestureDetector(
|
|
|
|
behavior: HitTestBehavior.opaque,
|
|
...
|
...
|
@@ -202,7 +223,9 @@ class TodayTabBody extends StatelessWidget { |
|
|
|
Obx(() {
|
|
|
|
return Get.find<UserStateService>().isVip
|
|
|
|
? const SizedBox.shrink()
|
|
|
|
: const PremiumCard();
|
|
|
|
: GestureDetector(
|
|
|
|
onTap: () => controller.toPremiumPage(),
|
|
|
|
child: const PremiumCard());
|
|
|
|
}),
|
|
|
|
Obx(() => controller.showHrvAdBanner.value
|
|
|
|
? TodayHrvAdBanner(controller: controller)
|
|
...
|
...
|
@@ -643,11 +666,13 @@ class _TopDateBar extends StatelessWidget { |
|
|
|
required this.title,
|
|
|
|
required this.showBackToToday,
|
|
|
|
required this.onBackToToday,
|
|
|
|
required this.onTapPremiumCard,
|
|
|
|
});
|
|
|
|
|
|
|
|
final String title;
|
|
|
|
final bool showBackToToday;
|
|
|
|
final VoidCallback onBackToToday;
|
|
|
|
final VoidCallback onTapPremiumCard;
|
|
|
|
final _topBarHeight = 48.0;
|
|
|
|
|
|
|
|
@override
|
|
...
|
...
|
@@ -699,35 +724,40 @@ class _TopDateBar extends StatelessWidget { |
|
|
|
Obx(() {
|
|
|
|
return Get.find<UserStateService>().isVip
|
|
|
|
? const SizedBox.shrink()
|
|
|
|
: Container(
|
|
|
|
height: 29,
|
|
|
|
constraints: const BoxConstraints(minWidth: 95),
|
|
|
|
padding: const EdgeInsets.symmetric(horizontal: 7),
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
color: const Color(0xFFFFDF51),
|
|
|
|
borderRadius: BorderRadius.circular(27.6),
|
|
|
|
),
|
|
|
|
child: Row(
|
|
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
children: [
|
|
|
|
Image.asset(
|
|
|
|
'assets/images/common/ic_pro.png',
|
|
|
|
width: 20,
|
|
|
|
height: 20,
|
|
|
|
color: context.colors.textPrimary,
|
|
|
|
),
|
|
|
|
const SizedBox(width: 2),
|
|
|
|
Text(
|
|
|
|
'20%优惠',
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: 14,
|
|
|
|
fontWeight: FontWeight.w500,
|
|
|
|
: GestureDetector(
|
|
|
|
onTap: () {
|
|
|
|
onTapPremiumCard.call();
|
|
|
|
},
|
|
|
|
child: Container(
|
|
|
|
height: 29,
|
|
|
|
constraints: const BoxConstraints(minWidth: 95),
|
|
|
|
padding: const EdgeInsets.symmetric(horizontal: 7),
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
color: const Color(0xFFFFDF51),
|
|
|
|
borderRadius: BorderRadius.circular(27.6),
|
|
|
|
),
|
|
|
|
child: Row(
|
|
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
children: [
|
|
|
|
Image.asset(
|
|
|
|
'assets/images/common/ic_pro.png',
|
|
|
|
width: 20,
|
|
|
|
height: 20,
|
|
|
|
color: context.colors.textPrimary,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
const SizedBox(width: 2),
|
|
|
|
Text(
|
|
|
|
'20%优惠',
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: 14,
|
|
|
|
fontWeight: FontWeight.w500,
|
|
|
|
color: context.colors.textPrimary,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
}),
|
...
|
...
|
|