chore: deprecate prev reply, videopage

Closes #579

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-04-01 12:41:03 +08:00
parent e4f3203351
commit cdb2718aeb
24 changed files with 399 additions and 823 deletions

View File

@@ -142,21 +142,15 @@ class _ListSheetContentState extends CommonSlidePageState<ListSheetContent>
}();
}
WidgetsBinding.instance.addPostFrameCallback((_) {
if (GStorage.collapsibleVideoPage) {
if (mounted) {
setState(() {
_isInit = false;
});
WidgetsBinding.instance.addPostFrameCallback((_) {
try {
itemScrollController[_index].jumpTo(index: currentIndex);
} catch (_) {}
});
}
} else {
try {
itemScrollController[_index].jumpTo(index: currentIndex);
} catch (_) {}
if (mounted) {
setState(() {
_isInit = false;
});
WidgetsBinding.instance.addPostFrameCallback((_) {
try {
itemScrollController[_index].jumpTo(index: currentIndex);
} catch (_) {}
});
}
});
}
@@ -295,7 +289,7 @@ class _ListSheetContentState extends CommonSlidePageState<ListSheetContent>
@override
Widget build(BuildContext context) {
if (GStorage.collapsibleVideoPage && _isInit) {
if (_isInit) {
return CustomScrollView(
physics: const NeverScrollableScrollPhysics(),
);

View File

@@ -1,5 +1,4 @@
import 'package:PiliPlus/common/widgets/http_error.dart';
import 'package:PiliPlus/utils/global_data.dart';
import 'package:flutter/material.dart';
Widget get loadingWidget => Center(child: CircularProgressIndicator());
@@ -19,27 +18,3 @@ Widget scrollErrorWidget({errMsg, callback}) => CustomScrollView(
)
],
);
Widget replyErrorWidget(context, isSliver, errMsg, onReload) => HttpError(
isSliver: isSliver,
errMsg:
'${errMsg.startsWith('gRPC Error') ? '如无法加载评论:\n关闭代理\n或设置中关闭使用gRPC加载评论\n\n' : ''}$errMsg',
callback: onReload,
extraWidget: errMsg.startsWith('gRPC Error') && GlobalData().grpcReply
? FilledButton.tonal(
onPressed: () {
GlobalData().grpcReply = false;
onReload();
},
style: ButtonStyle(
backgroundColor: WidgetStateProperty.resolveWith((states) {
return Theme.of(context).colorScheme.primary.withAlpha(20);
}),
),
child: Text(
'暂时关闭gRPC加载评论',
style: TextStyle(color: Theme.of(context).colorScheme.primary),
),
)
: null,
);