Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-08-16 22:43:57 +08:00
parent 55733d30c5
commit 5420712bda
15 changed files with 40 additions and 30 deletions

View File

@@ -1,3 +1,5 @@
import 'dart:io' show Platform;
import 'package:PiliPlus/pages/common/slide/common_slide_page.dart';
import 'package:flutter/material.dart';
@@ -16,24 +18,27 @@ abstract class CommonCollapseSlidePageState<T extends CommonCollapseSlidePage>
}
void init() {
WidgetsBinding.instance.addPostFrameCallback((_) {
isInit = false;
});
if (Platform.isAndroid) {
WidgetsBinding.instance.addPostFrameCallback((_) {
isInit = false;
});
}
}
@override
Widget build(BuildContext context) {
Widget child = super.build(context);
if (isInit) {
if (Platform.isAndroid) {
return Stack(
clipBehavior: Clip.none,
children: [
const CustomScrollView(
physics: NeverScrollableScrollPhysics(),
),
child,
if (isInit)
const CustomScrollView(
physics: NeverScrollableScrollPhysics(),
),
super.build(context),
],
);
}
return child;
return super.build(context);
}
}

View File

@@ -62,7 +62,6 @@ class _VotePanelState extends State<VotePanel> {
),
Flexible(
child: ListView.builder(
key: const PageStorageKey('vote_opions'),
shrinkWrap: true,
itemCount: _voteInfo.options.length,
itemBuilder: (context, index) => _buildOptions(index),

View File

@@ -261,7 +261,6 @@ class _EpisodePanelState extends CommonCollapseSlidePageState<EpisodePanel> {
final isCurrTab = tabIndex == widget.initialTabIndex;
return KeepAliveWrapper(
builder: (context) => ScrollablePositionedList.separated(
key: PageStorageKey(tabIndex),
padding: EdgeInsets.only(
top: 7,
bottom: MediaQuery.paddingOf(context).bottom + 80,

View File

@@ -56,7 +56,6 @@ class _PgcReviewChildPageState extends State<PgcReviewChildPage>
return refreshIndicator(
onRefresh: _controller.onRefresh,
child: CustomScrollView(
key: PageStorageKey(_tag),
controller: _controller.scrollController,
physics: const AlwaysScrollableScrollPhysics(),
slivers: [

View File

@@ -61,7 +61,6 @@ class _AiDetailState extends CommonCollapseSlidePageState<AiConclusionPanel> {
@override
Widget buildList(ThemeData theme) {
return CustomScrollView(
key: const PageStorageKey('ai_detail'),
controller: _controller,
physics: const AlwaysScrollableScrollPhysics(),
slivers: [

View File

@@ -99,7 +99,6 @@ class _IntroDetailState extends CommonCollapseSlidePageState<PgcIntroPanel> {
);
return SelectionArea(
child: ListView(
key: const PageStorageKey('pgc_intro'),
controller: _controller,
physics: const AlwaysScrollableScrollPhysics(),
padding: EdgeInsets.only(

View File

@@ -136,7 +136,6 @@ class _PagesPanelState extends State<PagesPanel> {
SizedBox(
height: 35,
child: ListView.builder(
key: PageStorageKey(hashCode),
controller: _scrollController,
scrollDirection: Axis.horizontal,
itemCount: pages.length,

View File

@@ -122,7 +122,6 @@ class _MediaListPanelState
() {
final showDelBtn = widget.onDelete != null && widget.mediaList.length > 1;
return ScrollablePositionedList.separated(
key: const PageStorageKey('medialist'),
itemScrollController: _controller,
physics: const AlwaysScrollableScrollPhysics(),
itemCount: widget.mediaList.length,

View File

@@ -112,7 +112,6 @@ class _PostPanelState extends CommonCollapseSlidePageState<PostPanel> {
clipBehavior: Clip.none,
children: [
SingleChildScrollView(
key: const PageStorageKey('segment_list'),
controller: _controller,
physics: const AlwaysScrollableScrollPhysics(),
padding: EdgeInsets.only(bottom: 88 + bottom),

View File

@@ -96,7 +96,6 @@ class _ViewPointsPageState
@override
Widget buildList(ThemeData theme) {
return ListView.builder(
key: const PageStorageKey('viewpoint'),
controller: _controller,
physics: const AlwaysScrollableScrollPhysics(),
padding: EdgeInsets.only(