mod: lint

mod: tweaks

opt: publish page

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-05-04 11:37:13 +08:00
parent 2cfad80214
commit caa58e9d7d
313 changed files with 2751 additions and 2789 deletions

View File

@@ -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(),
);
}

View File

@@ -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],

View File

@@ -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(

View File

@@ -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,