mod: 推荐、搜索页添加时间,修复视频搜索页无法筛选和回顶

This commit is contained in:
orz12
2024-01-20 21:05:01 +08:00
parent dc4bb75e55
commit e3fd70d9e6
4 changed files with 50 additions and 16 deletions

View File

@@ -1,6 +1,8 @@
import 'package:flutter/material.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:get/get.dart';
import 'stat/danmu.dart';
import 'stat/view.dart';
import '../../http/dynamics.dart';
import '../../http/search.dart';
import '../../http/user.dart';
@@ -322,18 +324,30 @@ class VideoStat extends StatelessWidget {
@override
Widget build(BuildContext context) {
return RichText(
maxLines: 1,
text: TextSpan(
style: TextStyle(
fontSize: Theme.of(context).textTheme.labelSmall!.fontSize,
color: Theme.of(context).colorScheme.outline,
return Row(
children: [
StatView(
theme: 'gray',
view: videoItem.stat.view as int,
),
children: [
TextSpan(text: '${Utils.numFormat(videoItem.stat.view)}观看'),
TextSpan(text: '${Utils.numFormat(videoItem.stat.danmu)}弹幕'),
],
),
const SizedBox(width: 8),
StatDanMu(
theme: 'gray',
danmu: videoItem.stat.danmu as int,
),
const Spacer(),
RichText(
maxLines: 1,
text: TextSpan(
style: TextStyle(
fontSize: Theme.of(context).textTheme.labelSmall!.fontSize,
color: Theme.of(context).colorScheme.outline,
),
text: Utils.formatTimestampToRelativeTime(videoItem.pubdate)
),
),
const SizedBox(width: 4),
],
);
}
}