mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
mod: lint
mod: tweaks opt: publish page Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -28,8 +28,8 @@ abstract class CommonCollapseSlidePageState<T extends CommonCollapseSlidePage>
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
if (isInit) {
|
||||
return CustomScrollView(
|
||||
physics: const NeverScrollableScrollPhysics(),
|
||||
return const CustomScrollView(
|
||||
physics: NeverScrollableScrollPhysics(),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -78,7 +78,7 @@ abstract class CommonPublishPageState<T extends CommonPublishPage>
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
void _requestFocus() async {
|
||||
Future<void> _requestFocus() async {
|
||||
await Future.delayed(const Duration(microseconds: 200));
|
||||
focusNode.requestFocus();
|
||||
}
|
||||
@@ -104,7 +104,7 @@ abstract class CommonPublishPageState<T extends CommonPublishPage>
|
||||
}
|
||||
}
|
||||
|
||||
updatePanelType(PanelType type) async {
|
||||
Future<void> updatePanelType(PanelType type) async {
|
||||
final isSwitchToKeyboard = PanelType.keyboard == type;
|
||||
final isSwitchToEmojiPanel = PanelType.emoji == type;
|
||||
bool isUpdated = false;
|
||||
@@ -119,7 +119,7 @@ abstract class CommonPublishPageState<T extends CommonPublishPage>
|
||||
break;
|
||||
}
|
||||
|
||||
updatePanelTypeFunc() {
|
||||
void updatePanelTypeFunc() {
|
||||
controller.updatePanelType(
|
||||
isSwitchToKeyboard
|
||||
? ChatBottomPanelType.keyboard
|
||||
@@ -141,7 +141,7 @@ abstract class CommonPublishPageState<T extends CommonPublishPage>
|
||||
}
|
||||
}
|
||||
|
||||
hidePanel() async {
|
||||
Future<void> hidePanel() async {
|
||||
if (focusNode.hasFocus) {
|
||||
await Future.delayed(const Duration(milliseconds: 100));
|
||||
focusNode.unfocus();
|
||||
@@ -224,7 +224,7 @@ abstract class CommonPublishPageState<T extends CommonPublishPage>
|
||||
widget.onSave?.call(editController.text);
|
||||
}
|
||||
|
||||
Widget? customPanel(double height) => null;
|
||||
Widget? get customPanel => null;
|
||||
|
||||
Widget buildEmojiPickerPanel() {
|
||||
double height = 170;
|
||||
@@ -232,7 +232,10 @@ abstract class CommonPublishPageState<T extends CommonPublishPage>
|
||||
if (keyboardHeight != 0) {
|
||||
height = max(height, keyboardHeight);
|
||||
}
|
||||
return customPanel(height) ?? SizedBox(height: height);
|
||||
return SizedBox(
|
||||
height: height,
|
||||
child: customPanel,
|
||||
);
|
||||
}
|
||||
|
||||
Widget buildPanelContainer([Color? panelBgColor]) {
|
||||
@@ -342,7 +345,7 @@ abstract class CommonPublishPageState<T extends CommonPublishPage>
|
||||
);
|
||||
}
|
||||
|
||||
void onCropImage(int index) async {
|
||||
Future<void> onCropImage(int index) async {
|
||||
final theme = Theme.of(context);
|
||||
CroppedFile? croppedFile = await ImageCropper().cropImage(
|
||||
sourcePath: pathList[index],
|
||||
|
||||
@@ -64,7 +64,7 @@ abstract class CommonSearchPageState<S extends CommonSearchPage, R, T>
|
||||
|
||||
Widget _buildBody(LoadingState<List<T>?> loadingState) {
|
||||
return switch (loadingState) {
|
||||
Loading() => HttpError(),
|
||||
Loading() => const HttpError(),
|
||||
Success() => loadingState.response?.isNotEmpty == true
|
||||
? buildList(loadingState.response!)
|
||||
: HttpError(
|
||||
|
||||
@@ -94,7 +94,7 @@ abstract class ReplyController<R> extends CommonListController<R, ReplyInfo> {
|
||||
}
|
||||
|
||||
// 排序搜索评论
|
||||
queryBySort() {
|
||||
void queryBySort() {
|
||||
EasyThrottle.throttle('queryBySort', const Duration(seconds: 1), () {
|
||||
feedBack();
|
||||
switch (sortType.value) {
|
||||
@@ -251,7 +251,7 @@ abstract class ReplyController<R> extends CommonListController<R, ReplyInfo> {
|
||||
}
|
||||
|
||||
// ref https://github.com/freedom-introvert/biliSendCommAntifraud
|
||||
void checkReply({
|
||||
Future<void> checkReply({
|
||||
required BuildContext context,
|
||||
required dynamic oid,
|
||||
required dynamic rpid,
|
||||
@@ -304,7 +304,7 @@ abstract class ReplyController<R> extends CommonListController<R, ReplyInfo> {
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (context) => AlertDialog(
|
||||
title: Text('评论检查结果'),
|
||||
title: const Text('评论检查结果'),
|
||||
content: SelectableText(message),
|
||||
),
|
||||
);
|
||||
@@ -479,7 +479,7 @@ https://api.bilibili.com/x/v2/reply/reply?oid=$oid&pn=1&ps=20&root=${rpid ?? rep
|
||||
}
|
||||
}
|
||||
|
||||
void onToggleTop(index, oid, int type, bool isUpTop, int rpid) async {
|
||||
Future<void> onToggleTop(index, oid, int type, bool isUpTop, int rpid) async {
|
||||
final res = await ReplyHttp.replyTop(
|
||||
oid: oid,
|
||||
type: type,
|
||||
|
||||
Reference in New Issue
Block a user