|
...
|
...
|
@@ -111,7 +111,11 @@ class _SleepReportViewState extends State<SleepReportView> { |
|
|
|
),
|
|
|
|
),
|
|
|
|
const SizedBox(height: 8),
|
|
|
|
_DateSwitcher(logic: widget.logic),
|
|
|
|
_DateSwitcher(
|
|
|
|
logic: widget.logic,
|
|
|
|
isVip: widget.isVip,
|
|
|
|
onSubscribe: widget.onSubscribe,
|
|
|
|
),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
...
|
...
|
@@ -208,20 +212,32 @@ class _DailyReportContent extends StatelessWidget { |
|
|
|
}
|
|
|
|
|
|
|
|
class _DateSwitcher extends StatelessWidget {
|
|
|
|
const _DateSwitcher({required this.logic});
|
|
|
|
const _DateSwitcher({
|
|
|
|
required this.logic,
|
|
|
|
required this.isVip,
|
|
|
|
required this.onSubscribe,
|
|
|
|
});
|
|
|
|
|
|
|
|
final SleepReportLogic logic;
|
|
|
|
final bool isVip;
|
|
|
|
final ValueChanged<String> onSubscribe;
|
|
|
|
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
return Obx(
|
|
|
|
() => ReportDateSwitcher(
|
|
|
|
label: logic.dateLabel,
|
|
|
|
onPrevious: logic.previousDay,
|
|
|
|
onNext: logic.nextDay,
|
|
|
|
onPrevious: isVip
|
|
|
|
? logic.previousDay
|
|
|
|
: () => onSubscribe('非会员切换日期-睡眠报告'),
|
|
|
|
onNext: isVip
|
|
|
|
? logic.nextDay
|
|
|
|
: () => onSubscribe('非会员切换日期-睡眠报告'),
|
|
|
|
canPrevious: logic.canGoPrevious,
|
|
|
|
canNext: logic.canGoNext,
|
|
|
|
onTapLabel: () => _showDatePicker(context),
|
|
|
|
onTapLabel: isVip
|
|
|
|
? () => _showDatePicker(context)
|
|
|
|
: () => onSubscribe('非会员切换日期-睡眠报告'),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
}
|
...
|
...
|
|