From ab9961853d48fc7028e6bd837e1af9678c803297 Mon Sep 17 00:00:00 2001 From: Developer Date: Wed, 1 Apr 2026 00:28:40 +0800 Subject: [PATCH] release --- lib/views/profile/profile_page.dart | 156 ++++++++++++++-------------- 1 file changed, 78 insertions(+), 78 deletions(-) diff --git a/lib/views/profile/profile_page.dart b/lib/views/profile/profile_page.dart index 2e023de..e0bc285 100644 --- a/lib/views/profile/profile_page.dart +++ b/lib/views/profile/profile_page.dart @@ -353,84 +353,6 @@ class _ProfilePageState extends State padding: const EdgeInsets.all(16), child: Column( children: [ - // 个人信息卡片 - Container( - width: double.infinity, - padding: const EdgeInsets.all(20), - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.circular(16), - boxShadow: [ - BoxShadow( - color: Colors.black.withValues(alpha: 0.08), - blurRadius: 10, - offset: const Offset(0, 2), - ), - ], - ), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - // === 卡片标题 === - Row( - children: [ - Icon( - Icons.person_outline, - color: AppConstants.primaryColor, - size: 20, - ), - const SizedBox(width: 8), - Text( - '统计', - style: TextStyle( - color: AppConstants.primaryColor, - fontSize: 16, - fontWeight: FontWeight.bold, - ), - ), - const Spacer(), - IconButton( - icon: Icon( - _isStatsHidden - ? Icons.visibility_off_outlined - : Icons.visibility_outlined, - color: Colors.grey[600], - size: 20, - ), - onPressed: () { - setState(() { - _isStatsHidden = !_isStatsHidden; - }); - HapticFeedback.lightImpact(); - }, - tooltip: _isStatsHidden ? '显示数据' : '隐藏数据', - ), - ], - ), - const SizedBox(height: 16), - // === 信息列表 === - if (!_isStatsHidden) ...[ - _buildInfoItem('今日浏览', '$_todayViews 条'), - _buildInfoItem('本周浏览', '$_weekViews 条'), - _buildInfoItem('已用', '$_useDays 天'), - _buildInfoItem('数据', _dataSize), - _buildInfoItem('笔记', '$_noteCount 个'), - _buildInfoItem('今日答题', '$_todayQuestions 题'), - _buildInfoItem('今日点赞', '$_todayLikes 个'), - ] else - Center( - child: Padding( - padding: const EdgeInsets.symmetric(vertical: 16), - child: Text( - '数据已隐藏', - style: TextStyle(color: Colors.grey[500], fontSize: 14), - ), - ), - ), - ], - ), - ), - const SizedBox(height: 16), // === 互动统计卡片 === Container( width: double.infinity, @@ -512,6 +434,84 @@ class _ProfilePageState extends State ], ), ), + const SizedBox(height: 16), + // 个人信息卡片 + Container( + width: double.infinity, + padding: const EdgeInsets.all(20), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(16), + boxShadow: [ + BoxShadow( + color: Colors.black.withValues(alpha: 0.08), + blurRadius: 10, + offset: const Offset(0, 2), + ), + ], + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + // === 卡片标题 === + Row( + children: [ + Icon( + Icons.person_outline, + color: AppConstants.primaryColor, + size: 20, + ), + const SizedBox(width: 8), + Text( + '统计', + style: TextStyle( + color: AppConstants.primaryColor, + fontSize: 16, + fontWeight: FontWeight.bold, + ), + ), + const Spacer(), + IconButton( + icon: Icon( + _isStatsHidden + ? Icons.visibility_off_outlined + : Icons.visibility_outlined, + color: Colors.grey[600], + size: 20, + ), + onPressed: () { + setState(() { + _isStatsHidden = !_isStatsHidden; + }); + HapticFeedback.lightImpact(); + }, + tooltip: _isStatsHidden ? '显示数据' : '隐藏数据', + ), + ], + ), + const SizedBox(height: 16), + // === 信息列表 === + if (!_isStatsHidden) ...[ + _buildInfoItem('今日浏览', '$_todayViews 条'), + _buildInfoItem('今日点赞', '$_todayLikes 个'), + _buildInfoItem('今日答题', '$_todayQuestions 题'), + _buildInfoItem('本周浏览', '$_weekViews 条'), + _buildInfoItem('数据', _dataSize), + _buildInfoItem('笔记', '$_noteCount 个'), + _buildInfoItem('已用', '$_useDays 天'), + ] else + Center( + child: Padding( + padding: const EdgeInsets.symmetric(vertical: 16), + child: Text( + '数据已隐藏', + style: TextStyle(color: Colors.grey[500], fontSize: 14), + ), + ), + ), + ], + ), + ), ], ), );