opt anim to top

opt refresh

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-05-23 22:37:57 +08:00
parent 0a9897f6a4
commit 81cfe3efe1
28 changed files with 154 additions and 43 deletions

View File

@@ -42,17 +42,18 @@ class _PgcIndexPageState extends State<PgcIndexPage>
: Obx(() => _buildBody(theme, _ctr.conditionState.value));
}
Widget _buildBody(ThemeData theme, LoadingState loadingState) {
Widget _buildBody(
ThemeData theme, LoadingState<PgcIndexCondition> loadingState) {
return switch (loadingState) {
Loading() => loadingWidget,
Success(:var response) => Builder(builder: (context) {
PgcIndexCondition data = response;
int count = (data.order?.isNotEmpty == true ? 1 : 0) +
(data.filter?.length ?? 0);
int count = (response.order?.isNotEmpty == true ? 1 : 0) +
(response.filter?.length ?? 0);
if (count == 0) return const SizedBox.shrink();
return SafeArea(
bottom: false,
child: CustomScrollView(
controller: _ctr.scrollController,
slivers: [
if (widget.indexType != null)
const SliverToBoxAdapter(child: SizedBox(height: 12)),
@@ -62,8 +63,8 @@ class _PgcIndexPageState extends State<PgcIndexPage>
alignment: Alignment.topCenter,
duration: const Duration(milliseconds: 200),
child: count > 5
? Obx(() => _buildSortWidget(theme, count, data))
: _buildSortWidget(theme, count, data),
? Obx(() => _buildSortWidget(theme, count, response))
: _buildSortWidget(theme, count, response),
),
),
SliverPadding(