fix: dyn pubtime

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-04-07 11:27:11 +08:00
parent 2317b831db
commit 99810ef512

View File

@@ -39,6 +39,9 @@ class AuthorPanel extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
String? pubTime = item.modules.moduleAuthor.pubTs != null
? Utils.dateFormat(item.modules.moduleAuthor.pubTs)
: item.modules.moduleAuthor.pubTime;
return Stack( return Stack(
alignment: Alignment.center, alignment: Alignment.center,
children: [ children: [
@@ -89,22 +92,15 @@ class AuthorPanel extends StatelessWidget {
Theme.of(context).textTheme.titleSmall!.fontSize, Theme.of(context).textTheme.titleSmall!.fontSize,
), ),
), ),
DefaultTextStyle.merge( if (pubTime != null)
style: TextStyle( Text(
color: Theme.of(context).colorScheme.outline, '$pubTime${item.modules.moduleAuthor.pubAction != null ? ' ${item.modules.moduleAuthor.pubAction}' : ''}',
fontSize: style: TextStyle(
Theme.of(context).textTheme.labelSmall!.fontSize, color: Theme.of(context).colorScheme.outline,
fontSize:
Theme.of(context).textTheme.labelSmall!.fontSize,
),
), ),
child: Row(
children: [
Text(Utils.dateFormat(item.modules.moduleAuthor.pubTs)),
if (item.modules.moduleAuthor.pubTs != '' &&
item.modules.moduleAuthor.pubAction != '')
const Text(' '),
Text(item.modules.moduleAuthor.pubAction),
],
),
)
], ],
), ),
], ],