From 5ff6ef880195c3e63a5006768870c0c0a97a3f9a Mon Sep 17 00:00:00 2001 From: bggRGjQaUbCoE Date: Mon, 7 Jul 2025 13:38:54 +0800 Subject: [PATCH] opt reply hint opt mention list header tweak Signed-off-by: bggRGjQaUbCoE --- lib/pages/article/view.dart | 2 +- lib/pages/common/reply_controller.dart | 8 ++++---- lib/pages/dynamics_create/view.dart | 2 +- lib/pages/dynamics_create_vote/view.dart | 10 ++++------ lib/pages/dynamics_mention/view.dart | 18 +++++++++++++----- lib/pages/msg_feed_top/sys_msg/controller.dart | 6 +----- lib/pages/msg_feed_top/sys_msg/view.dart | 9 ++++----- 7 files changed, 28 insertions(+), 27 deletions(-) diff --git a/lib/pages/article/view.dart b/lib/pages/article/view.dart index d33a92a6..46b0a5ae 100644 --- a/lib/pages/article/view.dart +++ b/lib/pages/article/view.dart @@ -648,7 +648,7 @@ class _ArticlePageState extends State return SliverPersistentHeader( pinned: true, delegate: CustomSliverPersistentHeaderDelegate( - extent: 40, + extent: 45, bgColor: theme.colorScheme.surface, child: Container( height: 45, diff --git a/lib/pages/common/reply_controller.dart b/lib/pages/common/reply_controller.dart index ae873860..4c964a1a 100644 --- a/lib/pages/common/reply_controller.dart +++ b/lib/pages/common/reply_controller.dart @@ -113,10 +113,10 @@ abstract class ReplyController extends CommonListController { assert(replyItem != null || (oid != null && replyType != null)); String? hint; try { - if (subjectControl != null) { - if (subjectControl!.hasSwitcherType() && - subjectControl!.switcherType != 1 && - subjectControl!.hasRootText()) { + if (subjectControl != null && subjectControl!.hasRootText()) { + if ((subjectControl!.hasSwitcherType() && + subjectControl!.switcherType != 1) || + subjectControl!.rootText.contains('可发评论')) { hint = subjectControl!.rootText; } } diff --git a/lib/pages/dynamics_create/view.dart b/lib/pages/dynamics_create/view.dart index 37cf87f9..9933def8 100644 --- a/lib/pages/dynamics_create/view.dart +++ b/lib/pages/dynamics_create/view.dart @@ -597,7 +597,7 @@ class _CreateDynPanelState extends CommonRichTextPubPageState { } controller.restoreChatPanel(); }, - icon: const Icon(Icons.bar_chart_rounded, size: 22), + icon: const Icon(Icons.bar_chart_rounded, size: 24), tooltip: '投票', selected: false, ), diff --git a/lib/pages/dynamics_create_vote/view.dart b/lib/pages/dynamics_create_vote/view.dart index 08dfe9a1..c9f2a594 100644 --- a/lib/pages/dynamics_create_vote/view.dart +++ b/lib/pages/dynamics_create_vote/view.dart @@ -25,16 +25,11 @@ class _CreateVotePageState extends State { tag: Utils.generateRandomString(8)); late final imagePicker = ImagePicker(); - late Divider _divider; late TextStyle _leadingStyle; @override Widget build(BuildContext context) { final theme = Theme.of(context); - _divider = Divider( - height: 1, - color: theme.colorScheme.outline.withValues(alpha: 0.1), - ); _leadingStyle = TextStyle( fontSize: 15, color: theme.colorScheme.onSurfaceVariant.withValues(alpha: 0.9), @@ -42,7 +37,10 @@ class _CreateVotePageState extends State { final padding = MediaQuery.paddingOf(context); final divider = [ const SizedBox(height: 10), - _divider, + Divider( + height: 1, + color: theme.colorScheme.outline.withValues(alpha: 0.1), + ), const SizedBox(height: 10), ]; return Scaffold( diff --git a/lib/pages/dynamics_mention/view.dart b/lib/pages/dynamics_mention/view.dart index e2283c90..9623fcea 100644 --- a/lib/pages/dynamics_mention/view.dart +++ b/lib/pages/dynamics_mention/view.dart @@ -1,6 +1,7 @@ import 'dart:async'; import 'dart:math'; +import 'package:PiliPlus/common/widgets/custom_sliver_persistent_header_delegate.dart'; import 'package:PiliPlus/common/widgets/draggable_sheet/draggable_scrollable_sheet_topic.dart' as topic_sheet; import 'package:PiliPlus/common/widgets/loading_widget/loading_widget.dart'; @@ -193,11 +194,18 @@ class _DynMentionPanelState extends State { } return SliverMainAxisGroup( slivers: [ - SliverToBoxAdapter( - child: Padding( - padding: const EdgeInsets.symmetric( - horizontal: 16, vertical: 6), - child: Text(group.groupName!), + SliverPersistentHeader( + pinned: true, + delegate: CustomSliverPersistentHeaderDelegate( + extent: 40, + bgColor: theme.colorScheme.surface, + child: Container( + height: 40, + alignment: Alignment.centerLeft, + padding: + const EdgeInsets.symmetric(horizontal: 16), + child: Text(group.groupName!), + ), ), ), SliverList.builder( diff --git a/lib/pages/msg_feed_top/sys_msg/controller.dart b/lib/pages/msg_feed_top/sys_msg/controller.dart index 1c33337d..1d50e598 100644 --- a/lib/pages/msg_feed_top/sys_msg/controller.dart +++ b/lib/pages/msg_feed_top/sys_msg/controller.dart @@ -6,7 +6,6 @@ import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; class SysMsgController extends CommonListController?, MsgSysItem> { - final pageSize = 20; int? cursor; @override @@ -21,9 +20,6 @@ class SysMsgController msgSysUpdateCursor(dataList.first.cursor); } cursor = dataList.last.cursor; - if (!isEnd && dataList.length + 1 < pageSize) { - isEnd = true; - } } void msgSysUpdateCursor(int? cursor) { @@ -54,5 +50,5 @@ class SysMsgController @override Future?>> customGetData() => - MsgHttp.msgFeedNotify(cursor: cursor, pageSize: pageSize); + MsgHttp.msgFeedNotify(cursor: cursor); } diff --git a/lib/pages/msg_feed_top/sys_msg/view.dart b/lib/pages/msg_feed_top/sys_msg/view.dart index 729dec92..f35acd16 100644 --- a/lib/pages/msg_feed_top/sys_msg/view.dart +++ b/lib/pages/msg_feed_top/sys_msg/view.dart @@ -23,6 +23,8 @@ class SysMsgPage extends StatefulWidget { class _SysMsgPageState extends State { late final _sysMsgController = Get.put(SysMsgController()); + late final RegExp urlRegExp = RegExp( + r'#\{([^}]*)\}\{([^}]*)\}|https?:\/\/[^\s/\$.?#].[^\s]*|www\.[^\s/\$.?#].[^\s]*|【(.*?)】|((\d+))'); @override Widget build(BuildContext context) { @@ -96,8 +98,8 @@ class _SysMsgPageState extends State { ), ), const SizedBox(height: 5), - SizedBox( - width: double.infinity, + Align( + alignment: Alignment.centerRight, child: Text( "${item.timeAt}", maxLines: 1, @@ -106,7 +108,6 @@ class _SysMsgPageState extends State { fontSize: 13, color: theme.colorScheme.outline, ), - textAlign: TextAlign.end, ), ), ], @@ -125,8 +126,6 @@ class _SysMsgPageState extends State { InlineSpan _buildContent(ThemeData theme, String content) { final List spanChildren = []; - RegExp urlRegExp = RegExp( - r'#\{([^}]*)\}\{([^}]*)\}|https?:\/\/[^\s/\$.?#].[^\s]*|www\.[^\s/\$.?#].[^\s]*|【(.*?)】|((\d+))'); content.splitMapJoin( urlRegExp, onMatch: (Match match) {