关怀模式

This commit is contained in:
Developer
2026-04-02 22:30:49 +08:00
parent 09fee0694c
commit 7872f2e78a
70 changed files with 4884 additions and 2752 deletions

View File

@@ -100,6 +100,7 @@ class _FootprintPageState extends State<FootprintPage>
try {
// 从SQLite获取完整数据
final likedList = await HistoryController.getLikedHistory();
final themeColor = _themeController.currentThemeColor;
// 查找对应的诗词数据,优先使用存储的完整数据
Map<String, dynamic> poetryData;
@@ -136,7 +137,9 @@ class _FootprintPageState extends State<FootprintPage>
width: 40,
height: 4,
decoration: BoxDecoration(
color: Colors.grey[300],
color: _themeController.isDarkMode
? Colors.grey[700]
: Colors.grey[300],
borderRadius: BorderRadius.circular(2),
),
),
@@ -146,17 +149,16 @@ class _FootprintPageState extends State<FootprintPage>
padding: const EdgeInsets.all(16),
child: Row(
children: [
Icon(
Icons.article,
color: AppConstants.primaryColor,
size: 24,
),
Icon(Icons.article, color: themeColor, size: 24),
const SizedBox(width: 8),
const Text(
Text(
'诗词详情',
style: TextStyle(
fontSize: 18,
fontWeight: FontWeight.bold,
color: _themeController.isDarkMode
? Colors.white
: Colors.black,
),
),
const Spacer(),
@@ -174,7 +176,9 @@ class _FootprintPageState extends State<FootprintPage>
padding: const EdgeInsets.all(8),
child: Icon(
Icons.more_horiz,
color: Colors.grey[600],
color: _themeController.isDarkMode
? Colors.grey[400]
: Colors.grey[600],
size: 20,
),
),
@@ -184,7 +188,9 @@ class _FootprintPageState extends State<FootprintPage>
IconButton(
onPressed: () => Navigator.of(context).pop(),
icon: const Icon(Icons.close),
color: Colors.grey[600],
color: _themeController.isDarkMode
? Colors.grey[400]
: Colors.grey[600],
),
],
),
@@ -202,7 +208,7 @@ class _FootprintPageState extends State<FootprintPage>
'精选诗句',
poetryData['name'] ?? poetry.name,
Icons.format_quote,
AppConstants.primaryColor,
themeColor,
),
// 时间和标签 - 同一行
@@ -277,7 +283,7 @@ class _FootprintPageState extends State<FootprintPage>
'译文/介绍',
poetryData['introduce'],
Icons.translate,
AppConstants.primaryColor,
themeColor,
),
// 原文 - 单独一行
@@ -319,6 +325,7 @@ class _FootprintPageState extends State<FootprintPage>
IconData icon,
Color accentColor,
) {
final isDark = _themeController.isDarkMode;
return Container(
width: double.infinity,
margin: const EdgeInsets.only(bottom: 12),
@@ -361,9 +368,9 @@ class _FootprintPageState extends State<FootprintPage>
padding: const EdgeInsets.all(12),
child: Text(
content,
style: const TextStyle(
style: TextStyle(
fontSize: 15,
color: Colors.black87,
color: isDark ? Colors.white : Colors.black87,
height: 1.5,
),
),
@@ -405,27 +412,26 @@ class _FootprintPageState extends State<FootprintPage>
Widget build(BuildContext context) {
return Obx(() {
final isDark = _themeController.isDarkMode;
final themeColor = _themeController.currentThemeColor;
return Scaffold(
backgroundColor: isDark ? const Color(0xFF1A1A1A) : Colors.grey[50],
appBar: AppBar(
title: const Text('点赞足迹'),
backgroundColor: isDark
? const Color(0xFF2A2A2A)
: AppConstants.primaryColor,
backgroundColor: isDark ? const Color(0xFF2A2A2A) : themeColor,
foregroundColor: Colors.white,
elevation: 0,
),
body: _buildBody(isDark),
body: _buildBody(isDark, themeColor),
);
});
}
Widget _buildBody(bool isDark) {
Widget _buildBody(bool isDark, Color themeColor) {
if (_isLoading) {
return Center(
child: CircularProgressIndicator(
valueColor: AlwaysStoppedAnimation<Color>(
isDark ? Colors.white : AppConstants.primaryColor,
isDark ? Colors.white : themeColor,
),
),
);
@@ -453,7 +459,7 @@ class _FootprintPageState extends State<FootprintPage>
ElevatedButton(
onPressed: _loadLikedPoetry,
style: ElevatedButton.styleFrom(
backgroundColor: AppConstants.primaryColor,
backgroundColor: themeColor,
foregroundColor: Colors.white,
),
child: const Text('重试'),
@@ -506,16 +512,14 @@ class _FootprintPageState extends State<FootprintPage>
Icon(
Icons.refresh,
size: 20,
color: isDark ? Colors.white70 : AppConstants.primaryColor,
color: isDark ? Colors.white70 : themeColor,
),
const SizedBox(width: 8),
Text(
'下拉刷新列表',
style: TextStyle(
fontSize: 14,
color: isDark
? Colors.white70
: AppConstants.primaryColor,
color: isDark ? Colors.white70 : themeColor,
fontWeight: FontWeight.w500,
),
),
@@ -537,7 +541,7 @@ class _FootprintPageState extends State<FootprintPage>
itemCount: _likedPoetryList.length,
itemBuilder: (context, index) {
final poetry = _likedPoetryList[index];
return _buildLikedPoetryCard(poetry, isDark);
return _buildLikedPoetryCard(poetry, isDark, themeColor);
},
),
),
@@ -546,7 +550,11 @@ class _FootprintPageState extends State<FootprintPage>
);
}
Widget _buildLikedPoetryCard(PoetryData poetry, bool isDark) {
Widget _buildLikedPoetryCard(
PoetryData poetry,
bool isDark,
Color themeColor,
) {
return Container(
margin: const EdgeInsets.only(bottom: 16),
decoration: BoxDecoration(
@@ -587,20 +595,20 @@ class _FootprintPageState extends State<FootprintPage>
decoration: BoxDecoration(
gradient: LinearGradient(
colors: [
AppConstants.primaryColor.withValues(alpha: 0.1),
AppConstants.primaryColor.withValues(alpha: 0.05),
themeColor.withValues(alpha: 0.1),
themeColor.withValues(alpha: 0.05),
],
begin: Alignment.topLeft,
end: Alignment.bottomRight,
),
borderRadius: BorderRadius.circular(12),
border: Border.all(
color: AppConstants.primaryColor.withValues(alpha: 0.2),
color: themeColor.withValues(alpha: 0.2),
width: 1,
),
boxShadow: [
BoxShadow(
color: AppConstants.primaryColor.withValues(alpha: 0.1),
color: themeColor.withValues(alpha: 0.1),
blurRadius: 8,
offset: const Offset(0, 2),
),
@@ -611,11 +619,7 @@ class _FootprintPageState extends State<FootprintPage>
children: [
Row(
children: [
Icon(
Icons.format_quote,
color: AppConstants.primaryColor,
size: 20,
),
Icon(Icons.format_quote, color: themeColor, size: 20),
const SizedBox(width: 8),
Expanded(
child: Text(
@@ -623,7 +627,7 @@ class _FootprintPageState extends State<FootprintPage>
style: TextStyle(
fontSize: 12,
fontWeight: FontWeight.w500,
color: AppConstants.primaryColor,
color: themeColor,
),
),
),
@@ -702,7 +706,7 @@ class _FootprintPageState extends State<FootprintPage>
icon: const Icon(Icons.visibility, size: 18),
label: const Text('查看详情'),
style: ElevatedButton.styleFrom(
backgroundColor: AppConstants.primaryColor,
backgroundColor: themeColor,
foregroundColor: Colors.white,
elevation: 2,
shape: RoundedRectangleBorder(