mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-16 23:26:14 +08:00
opt anim to top
opt refresh Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -37,6 +37,7 @@ class _ArticleListPageState extends State<ArticleListPage> {
|
|||||||
child: refreshIndicator(
|
child: refreshIndicator(
|
||||||
onRefresh: _controller.onRefresh,
|
onRefresh: _controller.onRefresh,
|
||||||
child: CustomScrollView(
|
child: CustomScrollView(
|
||||||
|
physics: const AlwaysScrollableScrollPhysics(),
|
||||||
slivers: [
|
slivers: [
|
||||||
Obx(() => _buildHeader(theme, _controller.list.value)),
|
Obx(() => _buildHeader(theme, _controller.list.value)),
|
||||||
SliverPadding(
|
SliverPadding(
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ import 'package:PiliPlus/pages/bangumi/controller.dart';
|
|||||||
import 'package:PiliPlus/pages/bangumi/widgets/bangumi_card_v.dart';
|
import 'package:PiliPlus/pages/bangumi/widgets/bangumi_card_v.dart';
|
||||||
import 'package:PiliPlus/pages/bangumi/widgets/bangumi_card_v_timeline.dart';
|
import 'package:PiliPlus/pages/bangumi/widgets/bangumi_card_v_timeline.dart';
|
||||||
import 'package:PiliPlus/pages/common/common_page.dart';
|
import 'package:PiliPlus/pages/common/common_page.dart';
|
||||||
|
import 'package:PiliPlus/pages/pgc_index/controller.dart';
|
||||||
import 'package:PiliPlus/pages/pgc_index/view.dart';
|
import 'package:PiliPlus/pages/pgc_index/view.dart';
|
||||||
import 'package:PiliPlus/utils/extension.dart';
|
import 'package:PiliPlus/utils/extension.dart';
|
||||||
import 'package:PiliPlus/utils/grid.dart';
|
import 'package:PiliPlus/utils/grid.dart';
|
||||||
@@ -241,25 +242,38 @@ class _BangumiPageState extends CommonPageState<BangumiPage, BangumiController>
|
|||||||
appBar: AppBar(title: const Text('索引')),
|
appBar: AppBar(title: const Text('索引')),
|
||||||
body: DefaultTabController(
|
body: DefaultTabController(
|
||||||
length: types.length,
|
length: types.length,
|
||||||
child: Column(
|
child: Builder(builder: (context) {
|
||||||
children: [
|
return Column(
|
||||||
SafeArea(
|
children: [
|
||||||
top: false,
|
SafeArea(
|
||||||
bottom: false,
|
top: false,
|
||||||
child: TabBar(
|
bottom: false,
|
||||||
|
child: TabBar(
|
||||||
tabs: titles
|
tabs: titles
|
||||||
.map((title) => Tab(text: title))
|
.map((title) => Tab(text: title))
|
||||||
.toList()),
|
.toList(),
|
||||||
),
|
onTap: (index) {
|
||||||
Expanded(
|
try {
|
||||||
child: tabBarView(
|
if (!DefaultTabController.of(context)
|
||||||
children: types
|
.indexIsChanging) {
|
||||||
.map((type) =>
|
Get.find<PgcIndexController>(
|
||||||
PgcIndexPage(indexType: type))
|
tag: types[index].toString())
|
||||||
.toList()),
|
.animateToTop();
|
||||||
)
|
}
|
||||||
],
|
} catch (_) {}
|
||||||
),
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Expanded(
|
||||||
|
child: tabBarView(
|
||||||
|
children: types
|
||||||
|
.map((type) =>
|
||||||
|
PgcIndexPage(indexType: type))
|
||||||
|
.toList()),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -46,6 +46,7 @@ class _DynTopicPageState extends State<DynTopicPage> {
|
|||||||
onRefresh: _controller.onRefresh,
|
onRefresh: _controller.onRefresh,
|
||||||
child: CustomScrollView(
|
child: CustomScrollView(
|
||||||
controller: _controller.scrollController,
|
controller: _controller.scrollController,
|
||||||
|
physics: const AlwaysScrollableScrollPhysics(),
|
||||||
slivers: [
|
slivers: [
|
||||||
Obx(() => _buildAppBar(theme, _controller.topState.value)),
|
Obx(() => _buildAppBar(theme, _controller.topState.value)),
|
||||||
Obx(() {
|
Obx(() {
|
||||||
|
|||||||
@@ -31,6 +31,8 @@ class _FavArticlePageState extends State<FavArticlePage>
|
|||||||
return refreshIndicator(
|
return refreshIndicator(
|
||||||
onRefresh: _favArticleController.onRefresh,
|
onRefresh: _favArticleController.onRefresh,
|
||||||
child: CustomScrollView(
|
child: CustomScrollView(
|
||||||
|
controller: _favArticleController.scrollController,
|
||||||
|
physics: const AlwaysScrollableScrollPhysics(),
|
||||||
slivers: [
|
slivers: [
|
||||||
SliverPadding(
|
SliverPadding(
|
||||||
padding: EdgeInsets.only(
|
padding: EdgeInsets.only(
|
||||||
|
|||||||
@@ -36,6 +36,8 @@ class _FavNoteChildPageState extends State<FavNoteChildPage>
|
|||||||
refreshIndicator(
|
refreshIndicator(
|
||||||
onRefresh: _favNoteController.onRefresh,
|
onRefresh: _favNoteController.onRefresh,
|
||||||
child: CustomScrollView(
|
child: CustomScrollView(
|
||||||
|
controller: _favNoteController.scrollController,
|
||||||
|
physics: const AlwaysScrollableScrollPhysics(),
|
||||||
slivers: [
|
slivers: [
|
||||||
SliverPadding(
|
SliverPadding(
|
||||||
padding: EdgeInsets.only(
|
padding: EdgeInsets.only(
|
||||||
|
|||||||
@@ -1,5 +1,8 @@
|
|||||||
import 'package:PiliPlus/pages/fav/note/child_view.dart';
|
import 'package:PiliPlus/pages/fav/note/child_view.dart';
|
||||||
|
import 'package:PiliPlus/pages/fav/note/controller.dart';
|
||||||
|
import 'package:PiliPlus/utils/extension.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:get/get.dart';
|
||||||
|
|
||||||
class FavNotePage extends StatefulWidget {
|
class FavNotePage extends StatefulWidget {
|
||||||
const FavNotePage({super.key});
|
const FavNotePage({super.key});
|
||||||
@@ -58,6 +61,16 @@ class _FavNotePageState extends State<FavNotePage>
|
|||||||
const Tab(text: '未发布笔记'),
|
const Tab(text: '未发布笔记'),
|
||||||
const Tab(text: '公开笔记'),
|
const Tab(text: '公开笔记'),
|
||||||
],
|
],
|
||||||
|
onTap: (index) {
|
||||||
|
try {
|
||||||
|
if (!_tabController.indexIsChanging) {
|
||||||
|
Get.find<FavNoteController>(
|
||||||
|
tag: index == 0 ? 'false' : 'true')
|
||||||
|
.scrollController
|
||||||
|
.animToTop();
|
||||||
|
}
|
||||||
|
} catch (_) {}
|
||||||
|
},
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
// TextButton(
|
// TextButton(
|
||||||
|
|||||||
@@ -43,6 +43,8 @@ class _FavPgcChildPageState extends State<FavPgcChildPage>
|
|||||||
refreshIndicator(
|
refreshIndicator(
|
||||||
onRefresh: _favPgcController.onRefresh,
|
onRefresh: _favPgcController.onRefresh,
|
||||||
child: CustomScrollView(
|
child: CustomScrollView(
|
||||||
|
controller: _favPgcController.scrollController,
|
||||||
|
physics: const AlwaysScrollableScrollPhysics(),
|
||||||
slivers: [
|
slivers: [
|
||||||
SliverPadding(
|
SliverPadding(
|
||||||
padding: EdgeInsets.only(
|
padding: EdgeInsets.only(
|
||||||
|
|||||||
@@ -1,5 +1,8 @@
|
|||||||
import 'package:PiliPlus/pages/fav/pgc/child_view.dart';
|
import 'package:PiliPlus/pages/fav/pgc/child_view.dart';
|
||||||
|
import 'package:PiliPlus/pages/fav/pgc/controller.dart';
|
||||||
|
import 'package:PiliPlus/utils/extension.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:get/get.dart';
|
||||||
|
|
||||||
class FavPgcPage extends StatefulWidget {
|
class FavPgcPage extends StatefulWidget {
|
||||||
const FavPgcPage({super.key, required this.type});
|
const FavPgcPage({super.key, required this.type});
|
||||||
@@ -61,6 +64,15 @@ class _FavPgcPageState extends State<FavPgcPage>
|
|||||||
Tab(text: '在看'),
|
Tab(text: '在看'),
|
||||||
Tab(text: '看过'),
|
Tab(text: '看过'),
|
||||||
],
|
],
|
||||||
|
onTap: (index) {
|
||||||
|
try {
|
||||||
|
if (!_tabController.indexIsChanging) {
|
||||||
|
Get.find<FavPgcController>(
|
||||||
|
tag: '${widget.type}${index + 1}',
|
||||||
|
).scrollController.animToTop();
|
||||||
|
}
|
||||||
|
} catch (_) {}
|
||||||
|
},
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
// TextButton(
|
// TextButton(
|
||||||
|
|||||||
@@ -30,6 +30,8 @@ class _FavTopicPageState extends State<FavTopicPage>
|
|||||||
return refreshIndicator(
|
return refreshIndicator(
|
||||||
onRefresh: _controller.onRefresh,
|
onRefresh: _controller.onRefresh,
|
||||||
child: CustomScrollView(
|
child: CustomScrollView(
|
||||||
|
controller: _controller.scrollController,
|
||||||
|
physics: const AlwaysScrollableScrollPhysics(),
|
||||||
slivers: [
|
slivers: [
|
||||||
SliverPadding(
|
SliverPadding(
|
||||||
padding: EdgeInsets.only(
|
padding: EdgeInsets.only(
|
||||||
|
|||||||
@@ -2,8 +2,11 @@ import 'package:PiliPlus/common/widgets/scroll_physics.dart';
|
|||||||
import 'package:PiliPlus/http/loading_state.dart';
|
import 'package:PiliPlus/http/loading_state.dart';
|
||||||
import 'package:PiliPlus/models/common/fav_type.dart';
|
import 'package:PiliPlus/models/common/fav_type.dart';
|
||||||
import 'package:PiliPlus/models/user/fav_folder.dart';
|
import 'package:PiliPlus/models/user/fav_folder.dart';
|
||||||
|
import 'package:PiliPlus/pages/fav/article/controller.dart';
|
||||||
|
import 'package:PiliPlus/pages/fav/topic/controller.dart';
|
||||||
import 'package:PiliPlus/pages/fav/video/controller.dart';
|
import 'package:PiliPlus/pages/fav/video/controller.dart';
|
||||||
import 'package:PiliPlus/pages/fav_folder_sort/view.dart';
|
import 'package:PiliPlus/pages/fav_folder_sort/view.dart';
|
||||||
|
import 'package:PiliPlus/utils/extension.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
@@ -122,6 +125,23 @@ class _FavPageState extends State<FavPage> with SingleTickerProviderStateMixin {
|
|||||||
isScrollable: true,
|
isScrollable: true,
|
||||||
tabAlignment: TabAlignment.start,
|
tabAlignment: TabAlignment.start,
|
||||||
tabs: FavTabType.values.map((item) => Tab(text: item.title)).toList(),
|
tabs: FavTabType.values.map((item) => Tab(text: item.title)).toList(),
|
||||||
|
onTap: (index) {
|
||||||
|
try {
|
||||||
|
if (!_tabController.indexIsChanging) {
|
||||||
|
switch (FavTabType.values[index]) {
|
||||||
|
case FavTabType.video:
|
||||||
|
_favController.scrollController.animToTop();
|
||||||
|
case FavTabType.article:
|
||||||
|
Get.find<FavArticleController>()
|
||||||
|
.scrollController
|
||||||
|
.animToTop();
|
||||||
|
case FavTabType.topic:
|
||||||
|
Get.find<FavTopicController>().scrollController.animToTop();
|
||||||
|
default:
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (_) {}
|
||||||
|
},
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
body: SafeArea(
|
body: SafeArea(
|
||||||
|
|||||||
@@ -40,6 +40,8 @@ class _LiveAreaChildPageState extends State<LiveAreaChildPage>
|
|||||||
return refreshIndicator(
|
return refreshIndicator(
|
||||||
onRefresh: _controller.onRefresh,
|
onRefresh: _controller.onRefresh,
|
||||||
child: CustomScrollView(
|
child: CustomScrollView(
|
||||||
|
controller: _controller.scrollController,
|
||||||
|
physics: const AlwaysScrollableScrollPhysics(),
|
||||||
slivers: [
|
slivers: [
|
||||||
SliverPadding(
|
SliverPadding(
|
||||||
padding: EdgeInsets.only(
|
padding: EdgeInsets.only(
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import 'package:PiliPlus/common/widgets/scroll_physics.dart';
|
|||||||
import 'package:PiliPlus/http/loading_state.dart';
|
import 'package:PiliPlus/http/loading_state.dart';
|
||||||
import 'package:PiliPlus/models/common/image_type.dart';
|
import 'package:PiliPlus/models/common/image_type.dart';
|
||||||
import 'package:PiliPlus/models/live/live_area_list/area_item.dart';
|
import 'package:PiliPlus/models/live/live_area_list/area_item.dart';
|
||||||
|
import 'package:PiliPlus/pages/live_area_detail/child/controller.dart';
|
||||||
import 'package:PiliPlus/pages/live_area_detail/child/view.dart';
|
import 'package:PiliPlus/pages/live_area_detail/child/view.dart';
|
||||||
import 'package:PiliPlus/pages/live_area_detail/controller.dart';
|
import 'package:PiliPlus/pages/live_area_detail/controller.dart';
|
||||||
import 'package:PiliPlus/pages/live_search/view.dart';
|
import 'package:PiliPlus/pages/live_search/view.dart';
|
||||||
@@ -76,6 +77,17 @@ class _LiveAreaDetailPageState extends State<LiveAreaDetailPage> {
|
|||||||
tabs: response
|
tabs: response
|
||||||
.map((e) => Tab(text: e.name ?? ''))
|
.map((e) => Tab(text: e.name ?? ''))
|
||||||
.toList(),
|
.toList(),
|
||||||
|
onTap: (index) {
|
||||||
|
try {
|
||||||
|
if (!DefaultTabController.of(context)
|
||||||
|
.indexIsChanging) {
|
||||||
|
final item = response[index];
|
||||||
|
Get.find<LiveAreaChildController>(
|
||||||
|
tag: '${item.id}${item.parentId}')
|
||||||
|
.animateToTop();
|
||||||
|
}
|
||||||
|
} catch (_) {}
|
||||||
|
},
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
iconButton(
|
iconButton(
|
||||||
|
|||||||
@@ -36,6 +36,7 @@ class _LiveFollowPageState extends State<LiveFollowPage> {
|
|||||||
child: refreshIndicator(
|
child: refreshIndicator(
|
||||||
onRefresh: _controller.onRefresh,
|
onRefresh: _controller.onRefresh,
|
||||||
child: CustomScrollView(
|
child: CustomScrollView(
|
||||||
|
physics: const AlwaysScrollableScrollPhysics(),
|
||||||
slivers: [
|
slivers: [
|
||||||
SliverPadding(
|
SliverPadding(
|
||||||
padding: EdgeInsets.only(
|
padding: EdgeInsets.only(
|
||||||
|
|||||||
@@ -77,20 +77,32 @@ class _LiveSearchPageState extends State<LiveSearchPage> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
onTap: (index) {
|
||||||
|
if (!_controller.tabController.indexIsChanging) {
|
||||||
|
if (index == 0) {
|
||||||
|
_controller.roomCtr.animateToTop();
|
||||||
|
} else {
|
||||||
|
_controller.userCtr.animateToTop();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
),
|
),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: tabBarView(
|
child: Material(
|
||||||
controller: _controller.tabController,
|
color: Colors.transparent,
|
||||||
children: [
|
child: tabBarView(
|
||||||
LiveSearchChildPage(
|
controller: _controller.tabController,
|
||||||
controller: _controller.roomCtr,
|
children: [
|
||||||
searchType: LiveSearchType.room,
|
LiveSearchChildPage(
|
||||||
),
|
controller: _controller.roomCtr,
|
||||||
LiveSearchChildPage(
|
searchType: LiveSearchType.room,
|
||||||
controller: _controller.userCtr,
|
),
|
||||||
searchType: LiveSearchType.user,
|
LiveSearchChildPage(
|
||||||
),
|
controller: _controller.userCtr,
|
||||||
],
|
searchType: LiveSearchType.user,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -2,6 +2,8 @@
|
|||||||
// Use of this source code is governed by a BSD-style license that can be
|
// Use of this source code is governed by a BSD-style license that can be
|
||||||
// found in the LICENSE file.
|
// found in the LICENSE file.
|
||||||
|
|
||||||
|
// ignore_for_file: uri_does_not_exist_in_doc_import
|
||||||
|
|
||||||
/// @docImport 'package:flutter/services.dart';
|
/// @docImport 'package:flutter/services.dart';
|
||||||
/// @docImport 'bottom_navigation_bar.dart';
|
/// @docImport 'bottom_navigation_bar.dart';
|
||||||
/// @docImport 'navigation_rail.dart';
|
/// @docImport 'navigation_rail.dart';
|
||||||
|
|||||||
@@ -39,6 +39,7 @@ class _MemberArticleState extends State<MemberArticle>
|
|||||||
return refreshIndicator(
|
return refreshIndicator(
|
||||||
onRefresh: _controller.onRefresh,
|
onRefresh: _controller.onRefresh,
|
||||||
child: CustomScrollView(
|
child: CustomScrollView(
|
||||||
|
physics: const AlwaysScrollableScrollPhysics(),
|
||||||
slivers: [
|
slivers: [
|
||||||
SliverPadding(
|
SliverPadding(
|
||||||
padding: EdgeInsets.only(
|
padding: EdgeInsets.only(
|
||||||
|
|||||||
@@ -41,6 +41,7 @@ class _MemberFavoriteState extends State<MemberFavorite>
|
|||||||
return refreshIndicator(
|
return refreshIndicator(
|
||||||
onRefresh: _controller.onRefresh,
|
onRefresh: _controller.onRefresh,
|
||||||
child: CustomScrollView(
|
child: CustomScrollView(
|
||||||
|
physics: const AlwaysScrollableScrollPhysics(),
|
||||||
slivers: [
|
slivers: [
|
||||||
SliverPadding(
|
SliverPadding(
|
||||||
padding: EdgeInsets.only(
|
padding: EdgeInsets.only(
|
||||||
|
|||||||
@@ -45,6 +45,7 @@ class _MemberOpusState extends State<MemberOpus>
|
|||||||
refreshIndicator(
|
refreshIndicator(
|
||||||
onRefresh: _controller.onRefresh,
|
onRefresh: _controller.onRefresh,
|
||||||
child: CustomScrollView(
|
child: CustomScrollView(
|
||||||
|
physics: const AlwaysScrollableScrollPhysics(),
|
||||||
slivers: [
|
slivers: [
|
||||||
SliverPadding(
|
SliverPadding(
|
||||||
padding: EdgeInsets.only(
|
padding: EdgeInsets.only(
|
||||||
|
|||||||
@@ -42,6 +42,7 @@ class _MemberBangumiState extends State<MemberBangumi>
|
|||||||
return refreshIndicator(
|
return refreshIndicator(
|
||||||
onRefresh: _controller.onRefresh,
|
onRefresh: _controller.onRefresh,
|
||||||
child: CustomScrollView(
|
child: CustomScrollView(
|
||||||
|
physics: const AlwaysScrollableScrollPhysics(),
|
||||||
slivers: [
|
slivers: [
|
||||||
SliverPadding(
|
SliverPadding(
|
||||||
padding: EdgeInsets.only(
|
padding: EdgeInsets.only(
|
||||||
|
|||||||
@@ -41,6 +41,7 @@ class _MemberSearchChildPageState extends State<MemberSearchChildPage>
|
|||||||
onRefresh: _controller.onRefresh,
|
onRefresh: _controller.onRefresh,
|
||||||
child: CustomScrollView(
|
child: CustomScrollView(
|
||||||
controller: _controller.scrollController,
|
controller: _controller.scrollController,
|
||||||
|
physics: const AlwaysScrollableScrollPhysics(),
|
||||||
slivers: [
|
slivers: [
|
||||||
SliverPadding(
|
SliverPadding(
|
||||||
padding: EdgeInsets.only(
|
padding: EdgeInsets.only(
|
||||||
|
|||||||
@@ -80,6 +80,15 @@ class _MemberSearchPageState extends State<MemberSearchPage> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
onTap: (index) {
|
||||||
|
if (!_controller.tabController.indexIsChanging) {
|
||||||
|
if (index == 0) {
|
||||||
|
_controller.arcCtr.animateToTop();
|
||||||
|
} else {
|
||||||
|
_controller.dynCtr.animateToTop();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
),
|
),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: tabBarView(
|
child: tabBarView(
|
||||||
|
|||||||
@@ -7,7 +7,8 @@ import 'package:get/get.dart';
|
|||||||
class PgcIndexController extends CommonListController {
|
class PgcIndexController extends CommonListController {
|
||||||
PgcIndexController(this.indexType);
|
PgcIndexController(this.indexType);
|
||||||
int? indexType;
|
int? indexType;
|
||||||
Rx<LoadingState> conditionState = LoadingState.loading().obs;
|
Rx<LoadingState<PgcIndexCondition>> conditionState =
|
||||||
|
LoadingState<PgcIndexCondition>.loading().obs;
|
||||||
|
|
||||||
late final RxBool isExpand = false.obs;
|
late final RxBool isExpand = false.obs;
|
||||||
|
|
||||||
|
|||||||
@@ -42,17 +42,18 @@ class _PgcIndexPageState extends State<PgcIndexPage>
|
|||||||
: Obx(() => _buildBody(theme, _ctr.conditionState.value));
|
: Obx(() => _buildBody(theme, _ctr.conditionState.value));
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget _buildBody(ThemeData theme, LoadingState loadingState) {
|
Widget _buildBody(
|
||||||
|
ThemeData theme, LoadingState<PgcIndexCondition> loadingState) {
|
||||||
return switch (loadingState) {
|
return switch (loadingState) {
|
||||||
Loading() => loadingWidget,
|
Loading() => loadingWidget,
|
||||||
Success(:var response) => Builder(builder: (context) {
|
Success(:var response) => Builder(builder: (context) {
|
||||||
PgcIndexCondition data = response;
|
int count = (response.order?.isNotEmpty == true ? 1 : 0) +
|
||||||
int count = (data.order?.isNotEmpty == true ? 1 : 0) +
|
(response.filter?.length ?? 0);
|
||||||
(data.filter?.length ?? 0);
|
|
||||||
if (count == 0) return const SizedBox.shrink();
|
if (count == 0) return const SizedBox.shrink();
|
||||||
return SafeArea(
|
return SafeArea(
|
||||||
bottom: false,
|
bottom: false,
|
||||||
child: CustomScrollView(
|
child: CustomScrollView(
|
||||||
|
controller: _ctr.scrollController,
|
||||||
slivers: [
|
slivers: [
|
||||||
if (widget.indexType != null)
|
if (widget.indexType != null)
|
||||||
const SliverToBoxAdapter(child: SizedBox(height: 12)),
|
const SliverToBoxAdapter(child: SizedBox(height: 12)),
|
||||||
@@ -62,8 +63,8 @@ class _PgcIndexPageState extends State<PgcIndexPage>
|
|||||||
alignment: Alignment.topCenter,
|
alignment: Alignment.topCenter,
|
||||||
duration: const Duration(milliseconds: 200),
|
duration: const Duration(milliseconds: 200),
|
||||||
child: count > 5
|
child: count > 5
|
||||||
? Obx(() => _buildSortWidget(theme, count, data))
|
? Obx(() => _buildSortWidget(theme, count, response))
|
||||||
: _buildSortWidget(theme, count, data),
|
: _buildSortWidget(theme, count, response),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
SliverPadding(
|
SliverPadding(
|
||||||
|
|||||||
@@ -40,6 +40,7 @@ class _ZonePageState extends CommonPageState<ZonePage, ZoneController>
|
|||||||
onRefresh: controller.onRefresh,
|
onRefresh: controller.onRefresh,
|
||||||
child: CustomScrollView(
|
child: CustomScrollView(
|
||||||
controller: controller.scrollController,
|
controller: controller.scrollController,
|
||||||
|
physics: const AlwaysScrollableScrollPhysics(),
|
||||||
slivers: [
|
slivers: [
|
||||||
SliverPadding(
|
SliverPadding(
|
||||||
padding: EdgeInsets.only(
|
padding: EdgeInsets.only(
|
||||||
|
|||||||
@@ -114,6 +114,7 @@ class _SearchTrendingPageState extends State<SearchTrendingPage> {
|
|||||||
onRefresh: _controller.onRefresh,
|
onRefresh: _controller.onRefresh,
|
||||||
child: CustomScrollView(
|
child: CustomScrollView(
|
||||||
controller: _controller.scrollController,
|
controller: _controller.scrollController,
|
||||||
|
physics: const AlwaysScrollableScrollPhysics(),
|
||||||
slivers: [
|
slivers: [
|
||||||
SliverToBoxAdapter(
|
SliverToBoxAdapter(
|
||||||
child: Image.asset(
|
child: Image.asset(
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ class _SubPageState extends State<SubPage> {
|
|||||||
child: refreshIndicator(
|
child: refreshIndicator(
|
||||||
onRefresh: _subController.onRefresh,
|
onRefresh: _subController.onRefresh,
|
||||||
child: CustomScrollView(
|
child: CustomScrollView(
|
||||||
|
physics: const AlwaysScrollableScrollPhysics(),
|
||||||
slivers: [
|
slivers: [
|
||||||
Obx(() => _buildBody(_subController.loadingState.value)),
|
Obx(() => _buildBody(_subController.loadingState.value)),
|
||||||
SliverToBoxAdapter(
|
SliverToBoxAdapter(
|
||||||
|
|||||||
@@ -138,9 +138,6 @@ class _MediaListPanelState
|
|||||||
widget.onDelete != null && widget.mediaList.length > 1;
|
widget.onDelete != null && widget.mediaList.length > 1;
|
||||||
return ScrollablePositionedList.separated(
|
return ScrollablePositionedList.separated(
|
||||||
itemScrollController: _scrollController,
|
itemScrollController: _scrollController,
|
||||||
// physics: const PositionRetainedScrollPhysics(
|
|
||||||
// parent: ClampingScrollPhysics(),
|
|
||||||
// ),
|
|
||||||
physics: const AlwaysScrollableScrollPhysics(),
|
physics: const AlwaysScrollableScrollPhysics(),
|
||||||
itemCount: widget.mediaList.length,
|
itemCount: widget.mediaList.length,
|
||||||
padding: EdgeInsets.only(
|
padding: EdgeInsets.only(
|
||||||
|
|||||||
@@ -92,10 +92,7 @@ class _HorizontalMemberPageState extends State<HorizontalMemberPage> {
|
|||||||
onRefresh: _controller.onRefresh,
|
onRefresh: _controller.onRefresh,
|
||||||
child: CustomScrollView(
|
child: CustomScrollView(
|
||||||
controller: _controller.scrollController,
|
controller: _controller.scrollController,
|
||||||
// physics: PositionRetainedScrollPhysics(
|
physics: const AlwaysScrollableScrollPhysics(),
|
||||||
// shouldRetain: _controller.hasPrev,
|
|
||||||
// parent: const ClampingScrollPhysics(),
|
|
||||||
// ),
|
|
||||||
slivers: [
|
slivers: [
|
||||||
_buildSliverHeader(theme),
|
_buildSliverHeader(theme),
|
||||||
Obx(() =>
|
Obx(() =>
|
||||||
|
|||||||
Reference in New Issue
Block a user