This commit is contained in:
Developer
2026-03-31 03:48:14 +08:00
parent 62729615b7
commit 888363785b
26 changed files with 219 additions and 808 deletions

View File

@@ -4,7 +4,6 @@
/// 最新变化: 新建文件
import 'dart:async';
import 'dart:convert';
import 'package:flutter/foundation.dart';
import 'package:shared_preferences/shared_preferences.dart';
import '../../../utils/http/poetry_api.dart';

View File

@@ -31,7 +31,6 @@ class _HomePageState extends State<HomePage>
bool _isLoadingLike = false;
String _errorMessage = '';
String _starDisplay = '';
final String _historyKey = 'poetry_history';
List<Map<String, dynamic>> _historyList = [];
int _currentHistoryIndex = -1;
late AnimationController _fadeController;
@@ -41,7 +40,6 @@ class _HomePageState extends State<HomePage>
// 动态加载状态
bool _isLoadingNext = false;
bool _isLoadingPrevious = false;
Map<String, bool> _sectionLoadingStates = {
'title': false,
'content': false,

View File

@@ -524,34 +524,26 @@ class _PoetryCardState extends State<PoetryCard> {
),
),
// 右边:星星和点赞
if (!isLoading &&
(widget.poetryData.star != null ||
widget.poetryData.like != null ||
widget.poetryData.hitsTotal != null))
if (!isLoading)
Row(
mainAxisSize: MainAxisSize.min,
children: [
if (widget.poetryData.star != null) ...[
Text(
PoetryDataUtils.generateStars(widget.poetryData.star),
style: const TextStyle(fontSize: 14),
Text(
PoetryDataUtils.generateStars(widget.poetryData.star),
style: const TextStyle(fontSize: 14),
),
const SizedBox(width: 4),
Text(
PoetryDataUtils.generateLikeText(widget.poetryData.like),
style: const TextStyle(fontSize: 12, color: Colors.grey),
),
const SizedBox(width: 4),
Text(
PoetryDataUtils.generateViewText(
widget.poetryData.hitsTotal,
),
const SizedBox(width: 4),
],
if (widget.poetryData.like != null) ...[
Text(
PoetryDataUtils.generateLikeText(widget.poetryData.like),
style: const TextStyle(fontSize: 12, color: Colors.grey),
),
],
if (widget.poetryData.hitsTotal != null) ...[
Text(
PoetryDataUtils.generateViewText(
widget.poetryData.hitsTotal,
),
style: const TextStyle(fontSize: 12, color: Colors.grey),
),
],
style: const TextStyle(fontSize: 12, color: Colors.grey),
),
],
),
],