fix(profile): 修复懒加载骨架屏一直显示的问题
- 将懒加载区域的加载状态初始值改为 false - 只有真正在加载时才显示骨架屏 - 修复条件判断逻辑导致的死锁问题 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
d29ff0975b
commit
0208022615
|
|
@ -106,7 +106,7 @@ class _ProfilePageState extends ConsumerState<ProfilePage> {
|
|||
double _settledUsdt = 0.0;
|
||||
double _expiredUsdt = 0.0;
|
||||
double _expiredPower = 0.0;
|
||||
bool _isLoadingWallet = true;
|
||||
bool _isLoadingWallet = false; // 懒加载,初始为 false
|
||||
String? _walletError;
|
||||
|
||||
// 待领取奖励列表(每一笔单独显示)
|
||||
|
|
@ -128,10 +128,10 @@ class _ProfilePageState extends ConsumerState<ProfilePage> {
|
|||
int _unreadNotificationCount = 0;
|
||||
|
||||
// ========== 懒加载 + 重试机制相关状态 ==========
|
||||
// 各区域加载状态
|
||||
// 各区域加载状态(懒加载区域初始为 false,等待可见时触发)
|
||||
bool _isLoadingUserData = true;
|
||||
bool _isLoadingReferral = true;
|
||||
bool _isLoadingAuthorization = true;
|
||||
bool _isLoadingReferral = false;
|
||||
bool _isLoadingAuthorization = false;
|
||||
String? _userDataError;
|
||||
String? _referralError;
|
||||
String? _authorizationError;
|
||||
|
|
@ -1403,8 +1403,8 @@ class _ProfilePageState extends ConsumerState<ProfilePage> {
|
|||
|
||||
/// 构建推荐人信息卡片(包含授权数据)
|
||||
Widget _buildReferralInfoCard() {
|
||||
// 显示加载状态(骨架屏)
|
||||
if (_isLoadingAuthorization && !_hasLoadedAuthorization) {
|
||||
// 显示加载状态(骨架屏)- 只有正在加载时才显示
|
||||
if (_isLoadingAuthorization) {
|
||||
return _buildSkeleton(height: 180);
|
||||
}
|
||||
|
||||
|
|
@ -1559,8 +1559,8 @@ class _ProfilePageState extends ConsumerState<ProfilePage> {
|
|||
|
||||
/// 构建主要内容卡片
|
||||
Widget _buildMainContentCard() {
|
||||
// 显示加载状态(骨架屏)- 收益数据
|
||||
if (_isLoadingWallet && !_hasLoadedWallet) {
|
||||
// 显示加载状态(骨架屏)- 只有正在加载时才显示
|
||||
if (_isLoadingWallet) {
|
||||
return _buildSkeleton(height: 400);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue