mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-05-30 23:58:13 +08:00
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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),
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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: [
|
||||
|
||||
@@ -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: [
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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),
|
||||
|
||||
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user