From 99810ef5128f75d220c6d40e02ebd66b2fbc7272 Mon Sep 17 00:00:00 2001 From: bggRGjQaUbCoE Date: Mon, 7 Apr 2025 11:27:11 +0800 Subject: [PATCH] fix: dyn pubtime Signed-off-by: bggRGjQaUbCoE --- lib/pages/dynamics/widgets/author_panel.dart | 26 +++++++++----------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/lib/pages/dynamics/widgets/author_panel.dart b/lib/pages/dynamics/widgets/author_panel.dart index 106dd811..06852d47 100644 --- a/lib/pages/dynamics/widgets/author_panel.dart +++ b/lib/pages/dynamics/widgets/author_panel.dart @@ -39,6 +39,9 @@ class AuthorPanel extends StatelessWidget { @override Widget build(BuildContext context) { + String? pubTime = item.modules.moduleAuthor.pubTs != null + ? Utils.dateFormat(item.modules.moduleAuthor.pubTs) + : item.modules.moduleAuthor.pubTime; return Stack( alignment: Alignment.center, children: [ @@ -89,22 +92,15 @@ class AuthorPanel extends StatelessWidget { Theme.of(context).textTheme.titleSmall!.fontSize, ), ), - DefaultTextStyle.merge( - style: TextStyle( - color: Theme.of(context).colorScheme.outline, - fontSize: - Theme.of(context).textTheme.labelSmall!.fontSize, + if (pubTime != null) + Text( + '$pubTime${item.modules.moduleAuthor.pubAction != null ? ' ${item.modules.moduleAuthor.pubAction}' : ''}', + style: TextStyle( + 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), - ], - ), - ) ], ), ],