feat:更新闪灵UI模块

This commit is contained in:
2025-11-10 13:35:31 +08:00
parent e84be63d9f
commit d25d347bcd
4 changed files with 214 additions and 210 deletions

View File

@@ -49,11 +49,7 @@ Widget _buildFlispContent(Flisp flisp) {
return RichText(
text: TextSpan(
text: flisp.content,
style: const TextStyle(
color: Colors.black87,
fontWeight: FontWeight.bold,
fontSize: 18,
),
style: const TextStyle(color: Colors.black87, fontSize: 16),
),
);
}
@@ -136,28 +132,50 @@ Widget _buildFlispVideo(Flisp flisp) {
);
}
Widget _buildFlispTag(Flisp flisp) {
return Row(
children: [
// 只有一个标签,直接显示
Container(
padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 2),
decoration: BoxDecoration(
color: Colors.orange,
borderRadius: BorderRadius.circular(12),
Widget buildFlispTag(Flisp flisp) {
return Container(
padding: EdgeInsets.symmetric(horizontal: 12, vertical: 6),
decoration: BoxDecoration(
color: flisp.tag.color.withAlpha(30),
borderRadius: BorderRadius.circular(8),
border: Border.all(color: flisp.tag.color.withAlpha(60)),
),
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
Container(
width: 14,
height: 14,
decoration: BoxDecoration(
color: flisp.tag.color,
shape: BoxShape.circle,
),
child: Icon(flisp.tag.icon, size: 8, color: Colors.white),
),
child: Text(
SizedBox(width: 6),
Text(
flisp.tag.label,
style: const TextStyle(fontSize: 12, color: Colors.white),
style: TextStyle(
fontSize: 12,
color: flisp.tag.color,
fontWeight: FontWeight.w500,
),
),
),
const Spacer(),
// 时间在后
Text(
DateFormat('yyyy-MM-dd HH:mm').format(flisp.createTime),
style: TextStyle(fontSize: 12, color: Colors.grey[500]),
),
],
],
),
);
}
Widget buildFlispTime(Flisp flisp) {
return Text(
DateFormat('yyyy-MM-dd HH:mm:ss').format(flisp.createTime),
style: TextStyle(fontSize: 12, color: Colors.grey),
);
}
Widget _buildFlispSuffix(Flisp flisp) {
return Row(
children: [buildFlispTag(flisp), const Spacer(), buildFlispTime(flisp)],
);
}
@@ -180,7 +198,7 @@ Widget _buildFlispItem({
const SizedBox(height: 4),
if (hasVideo) _buildFlispVideo(flisp),
const SizedBox(height: 4),
_buildFlispTag(flisp),
_buildFlispSuffix(flisp),
],
),
),
@@ -193,9 +211,9 @@ Widget buildEmptyState() {
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Icon(Icons.checklist, size: 80, color: Colors.orange.shade600),
Icon(Icons.flash_on, size: 80, color: Colors.orange.shade600),
Text(
'📝 还没有闪灵\n点击➕号添加第一个任务吧~',
'📝 还没有闪灵\n点击➕号添加第一个灵感吧~',
textAlign: TextAlign.center,
style: TextStyle(color: Colors.orange.shade600),
),