重构
This commit is contained in:
@@ -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),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user