mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-06-01 00:28:18 +08:00
mod: show reply rootText
Closes #605 Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -115,6 +115,18 @@ abstract class ReplyController extends CommonController {
|
|||||||
int index = 0,
|
int index = 0,
|
||||||
ReplyType? replyType,
|
ReplyType? replyType,
|
||||||
}) {
|
}) {
|
||||||
|
String? hint;
|
||||||
|
try {
|
||||||
|
if (loadingState.value is Success) {
|
||||||
|
SubjectControl subjectControl =
|
||||||
|
(loadingState.value as Success).response.subjectControl;
|
||||||
|
if (subjectControl.hasSwitcherType() &&
|
||||||
|
subjectControl.switcherType != 1 &&
|
||||||
|
subjectControl.hasRootText()) {
|
||||||
|
hint = subjectControl.rootText;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (_) {}
|
||||||
dynamic key = oid ?? replyItem.oid + replyItem.id;
|
dynamic key = oid ?? replyItem.oid + replyItem.id;
|
||||||
Navigator.of(context)
|
Navigator.of(context)
|
||||||
.push(
|
.push(
|
||||||
@@ -132,6 +144,7 @@ abstract class ReplyController extends CommonController {
|
|||||||
onSave: (reply) {
|
onSave: (reply) {
|
||||||
savedReplies[key] = reply;
|
savedReplies[key] = reply;
|
||||||
},
|
},
|
||||||
|
hint: hint,
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
transitionDuration: const Duration(milliseconds: 500),
|
transitionDuration: const Duration(milliseconds: 500),
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ class ReplyPage extends CommonPublishPage {
|
|||||||
final int? parent;
|
final int? parent;
|
||||||
final ReplyType? replyType;
|
final ReplyType? replyType;
|
||||||
final dynamic replyItem;
|
final dynamic replyItem;
|
||||||
|
final String? hint;
|
||||||
|
|
||||||
const ReplyPage({
|
const ReplyPage({
|
||||||
super.key,
|
super.key,
|
||||||
@@ -28,6 +29,7 @@ class ReplyPage extends CommonPublishPage {
|
|||||||
this.parent,
|
this.parent,
|
||||||
this.replyType,
|
this.replyType,
|
||||||
this.replyItem,
|
this.replyItem,
|
||||||
|
this.hint,
|
||||||
});
|
});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@@ -161,8 +163,8 @@ class _ReplyPageState extends CommonPublishPageState<ReplyPage> {
|
|||||||
widget.onSave?.call(value);
|
widget.onSave?.call(value);
|
||||||
},
|
},
|
||||||
focusNode: focusNode,
|
focusNode: focusNode,
|
||||||
decoration: const InputDecoration(
|
decoration: InputDecoration(
|
||||||
hintText: "输入回复内容",
|
hintText: widget.hint ?? "输入回复内容",
|
||||||
border: InputBorder.none,
|
border: InputBorder.none,
|
||||||
hintStyle: TextStyle(fontSize: 14)),
|
hintStyle: TextStyle(fontSize: 14)),
|
||||||
style: themeData.textTheme.bodyLarge,
|
style: themeData.textTheme.bodyLarge,
|
||||||
|
|||||||
Reference in New Issue
Block a user