Commit 1078da2b8aa5ebe67b8a43af8d99d594d9901b91

Authored by 常守达
1 parent 13d89eb0

fix(today):首页等待数据loading

... ... @@ -12,6 +12,7 @@ import 'package:doublefeel_flutter/l10n/l10n_extensions.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:intl/intl.dart';
import 'package:lottie/lottie.dart';
import 'package:table_calendar/table_calendar.dart';
import '../../controllers/today_controller.dart';
... ... @@ -196,17 +197,28 @@ class TodayTabBody extends StatelessWidget {
),
),
Obx(
() => Text(
controller.v2StressScore.value?.stateString() ?? '',
textAlign: TextAlign.center,
style: TextStyle(
color: context.colors.textPrimary,
fontSize: 28,
fontWeight: FontWeight.w500,
),
),
() => controller.isLoadingToday.value
? Lottie.asset(
'assets/lottie/loading.json',
width: 65,
height: 45,
repeat: true,
animate: true,
)
: Padding(
padding: const EdgeInsets.only(bottom: 12),
child: Text(
controller.v2StressScore.value?.stateString() ??
'',
textAlign: TextAlign.center,
style: TextStyle(
color: context.colors.textPrimary,
fontSize: 28,
fontWeight: FontWeight.w500,
),
),
),
),
const SizedBox(height: 12),
Obx(
() => StressProgressBar(
score: controller.v2StressScore.value?.state == 0
... ...