mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-06-01 00:28:18 +08:00
opt reply hint
opt mention list header tweak Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -648,7 +648,7 @@ class _ArticlePageState extends State<ArticlePage>
|
|||||||
return SliverPersistentHeader(
|
return SliverPersistentHeader(
|
||||||
pinned: true,
|
pinned: true,
|
||||||
delegate: CustomSliverPersistentHeaderDelegate(
|
delegate: CustomSliverPersistentHeaderDelegate(
|
||||||
extent: 40,
|
extent: 45,
|
||||||
bgColor: theme.colorScheme.surface,
|
bgColor: theme.colorScheme.surface,
|
||||||
child: Container(
|
child: Container(
|
||||||
height: 45,
|
height: 45,
|
||||||
|
|||||||
@@ -113,10 +113,10 @@ abstract class ReplyController<R> extends CommonListController<R, ReplyInfo> {
|
|||||||
assert(replyItem != null || (oid != null && replyType != null));
|
assert(replyItem != null || (oid != null && replyType != null));
|
||||||
String? hint;
|
String? hint;
|
||||||
try {
|
try {
|
||||||
if (subjectControl != null) {
|
if (subjectControl != null && subjectControl!.hasRootText()) {
|
||||||
if (subjectControl!.hasSwitcherType() &&
|
if ((subjectControl!.hasSwitcherType() &&
|
||||||
subjectControl!.switcherType != 1 &&
|
subjectControl!.switcherType != 1) ||
|
||||||
subjectControl!.hasRootText()) {
|
subjectControl!.rootText.contains('可发评论')) {
|
||||||
hint = subjectControl!.rootText;
|
hint = subjectControl!.rootText;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -597,7 +597,7 @@ class _CreateDynPanelState extends CommonRichTextPubPageState<CreateDynPanel> {
|
|||||||
}
|
}
|
||||||
controller.restoreChatPanel();
|
controller.restoreChatPanel();
|
||||||
},
|
},
|
||||||
icon: const Icon(Icons.bar_chart_rounded, size: 22),
|
icon: const Icon(Icons.bar_chart_rounded, size: 24),
|
||||||
tooltip: '投票',
|
tooltip: '投票',
|
||||||
selected: false,
|
selected: false,
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -25,16 +25,11 @@ class _CreateVotePageState extends State<CreateVotePage> {
|
|||||||
tag: Utils.generateRandomString(8));
|
tag: Utils.generateRandomString(8));
|
||||||
late final imagePicker = ImagePicker();
|
late final imagePicker = ImagePicker();
|
||||||
|
|
||||||
late Divider _divider;
|
|
||||||
late TextStyle _leadingStyle;
|
late TextStyle _leadingStyle;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final theme = Theme.of(context);
|
final theme = Theme.of(context);
|
||||||
_divider = Divider(
|
|
||||||
height: 1,
|
|
||||||
color: theme.colorScheme.outline.withValues(alpha: 0.1),
|
|
||||||
);
|
|
||||||
_leadingStyle = TextStyle(
|
_leadingStyle = TextStyle(
|
||||||
fontSize: 15,
|
fontSize: 15,
|
||||||
color: theme.colorScheme.onSurfaceVariant.withValues(alpha: 0.9),
|
color: theme.colorScheme.onSurfaceVariant.withValues(alpha: 0.9),
|
||||||
@@ -42,7 +37,10 @@ class _CreateVotePageState extends State<CreateVotePage> {
|
|||||||
final padding = MediaQuery.paddingOf(context);
|
final padding = MediaQuery.paddingOf(context);
|
||||||
final divider = [
|
final divider = [
|
||||||
const SizedBox(height: 10),
|
const SizedBox(height: 10),
|
||||||
_divider,
|
Divider(
|
||||||
|
height: 1,
|
||||||
|
color: theme.colorScheme.outline.withValues(alpha: 0.1),
|
||||||
|
),
|
||||||
const SizedBox(height: 10),
|
const SizedBox(height: 10),
|
||||||
];
|
];
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
import 'dart:math';
|
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'
|
import 'package:PiliPlus/common/widgets/draggable_sheet/draggable_scrollable_sheet_topic.dart'
|
||||||
as topic_sheet;
|
as topic_sheet;
|
||||||
import 'package:PiliPlus/common/widgets/loading_widget/loading_widget.dart';
|
import 'package:PiliPlus/common/widgets/loading_widget/loading_widget.dart';
|
||||||
@@ -193,13 +194,20 @@ class _DynMentionPanelState extends State<DynMentionPanel> {
|
|||||||
}
|
}
|
||||||
return SliverMainAxisGroup(
|
return SliverMainAxisGroup(
|
||||||
slivers: [
|
slivers: [
|
||||||
SliverToBoxAdapter(
|
SliverPersistentHeader(
|
||||||
child: Padding(
|
pinned: true,
|
||||||
padding: const EdgeInsets.symmetric(
|
delegate: CustomSliverPersistentHeaderDelegate(
|
||||||
horizontal: 16, vertical: 6),
|
extent: 40,
|
||||||
|
bgColor: theme.colorScheme.surface,
|
||||||
|
child: Container(
|
||||||
|
height: 40,
|
||||||
|
alignment: Alignment.centerLeft,
|
||||||
|
padding:
|
||||||
|
const EdgeInsets.symmetric(horizontal: 16),
|
||||||
child: Text(group.groupName!),
|
child: Text(group.groupName!),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
),
|
||||||
SliverList.builder(
|
SliverList.builder(
|
||||||
itemCount: group.items!.length,
|
itemCount: group.items!.length,
|
||||||
itemBuilder: (context, index) {
|
itemBuilder: (context, index) {
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
|||||||
|
|
||||||
class SysMsgController
|
class SysMsgController
|
||||||
extends CommonListController<List<MsgSysItem>?, MsgSysItem> {
|
extends CommonListController<List<MsgSysItem>?, MsgSysItem> {
|
||||||
final pageSize = 20;
|
|
||||||
int? cursor;
|
int? cursor;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@@ -21,9 +20,6 @@ class SysMsgController
|
|||||||
msgSysUpdateCursor(dataList.first.cursor);
|
msgSysUpdateCursor(dataList.first.cursor);
|
||||||
}
|
}
|
||||||
cursor = dataList.last.cursor;
|
cursor = dataList.last.cursor;
|
||||||
if (!isEnd && dataList.length + 1 < pageSize) {
|
|
||||||
isEnd = true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void msgSysUpdateCursor(int? cursor) {
|
void msgSysUpdateCursor(int? cursor) {
|
||||||
@@ -54,5 +50,5 @@ class SysMsgController
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Future<LoadingState<List<MsgSysItem>?>> customGetData() =>
|
Future<LoadingState<List<MsgSysItem>?>> customGetData() =>
|
||||||
MsgHttp.msgFeedNotify(cursor: cursor, pageSize: pageSize);
|
MsgHttp.msgFeedNotify(cursor: cursor);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,6 +23,8 @@ class SysMsgPage extends StatefulWidget {
|
|||||||
|
|
||||||
class _SysMsgPageState extends State<SysMsgPage> {
|
class _SysMsgPageState extends State<SysMsgPage> {
|
||||||
late final _sysMsgController = Get.put(SysMsgController());
|
late final _sysMsgController = Get.put(SysMsgController());
|
||||||
|
late final RegExp urlRegExp = RegExp(
|
||||||
|
r'#\{([^}]*)\}\{([^}]*)\}|https?:\/\/[^\s/\$.?#].[^\s]*|www\.[^\s/\$.?#].[^\s]*|【(.*?)】|((\d+))');
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
@@ -96,8 +98,8 @@ class _SysMsgPageState extends State<SysMsgPage> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
const SizedBox(height: 5),
|
const SizedBox(height: 5),
|
||||||
SizedBox(
|
Align(
|
||||||
width: double.infinity,
|
alignment: Alignment.centerRight,
|
||||||
child: Text(
|
child: Text(
|
||||||
"${item.timeAt}",
|
"${item.timeAt}",
|
||||||
maxLines: 1,
|
maxLines: 1,
|
||||||
@@ -106,7 +108,6 @@ class _SysMsgPageState extends State<SysMsgPage> {
|
|||||||
fontSize: 13,
|
fontSize: 13,
|
||||||
color: theme.colorScheme.outline,
|
color: theme.colorScheme.outline,
|
||||||
),
|
),
|
||||||
textAlign: TextAlign.end,
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
@@ -125,8 +126,6 @@ class _SysMsgPageState extends State<SysMsgPage> {
|
|||||||
|
|
||||||
InlineSpan _buildContent(ThemeData theme, String content) {
|
InlineSpan _buildContent(ThemeData theme, String content) {
|
||||||
final List<InlineSpan> spanChildren = <InlineSpan>[];
|
final List<InlineSpan> spanChildren = <InlineSpan>[];
|
||||||
RegExp urlRegExp = RegExp(
|
|
||||||
r'#\{([^}]*)\}\{([^}]*)\}|https?:\/\/[^\s/\$.?#].[^\s]*|www\.[^\s/\$.?#].[^\s]*|【(.*?)】|((\d+))');
|
|
||||||
content.splitMapJoin(
|
content.splitMapJoin(
|
||||||
urlRegExp,
|
urlRegExp,
|
||||||
onMatch: (Match match) {
|
onMatch: (Match match) {
|
||||||
|
|||||||
Reference in New Issue
Block a user