feat: app端推荐添加时间显示(测试)

This commit is contained in:
orz12
2024-09-08 22:18:06 +08:00
committed by bggRGjQaUbCoE
parent be8b301473
commit a4a1cb1371
3 changed files with 30 additions and 0 deletions

View File

@@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:get/get.dart';
import '../../models/home/rcmd/result.dart';
import '../../models/model_rec_video_item.dart';
import 'stat/danmu.dart';
import 'stat/view.dart';
@@ -332,6 +333,27 @@ class VideoStat extends StatelessWidget {
Utils.formatTimestampToRelativeTime(videoItem.pubdate)),
)),
const SizedBox(width: 2),
],
if (videoItem is RecVideoItemAppModel &&
videoItem.desc != null &&
videoItem.desc.contains(' · ')) ...<Widget>[
const Spacer(),
Expanded(
flex: 0,
child: RichText(
maxLines: 1,
text: TextSpan(
style: TextStyle(
fontSize:
Theme.of(context).textTheme.labelSmall!.fontSize,
color: Theme.of(context)
.colorScheme
.outline
.withOpacity(0.8),
),
text: Utils.shortenChineseDateString(videoItem.desc.split(' · ').last)),
)),
const SizedBox(width: 2),
]
],
);