This commit is contained in:
Developer
2026-04-01 00:28:40 +08:00
parent 58c6e74e9f
commit ab9961853d

View File

@@ -353,84 +353,6 @@ class _ProfilePageState extends State<ProfilePage>
padding: const EdgeInsets.all(16), padding: const EdgeInsets.all(16),
child: Column( child: Column(
children: [ 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( Container(
width: double.infinity, width: double.infinity,
@@ -512,6 +434,84 @@ class _ProfilePageState extends State<ProfilePage>
], ],
), ),
), ),
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),
),
),
),
],
),
),
], ],
), ),
); );