Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-05-18 16:56:43 +08:00
parent f642bfcf48
commit ab80b2a5af
24 changed files with 876 additions and 871 deletions

View File

@@ -124,7 +124,12 @@ class _DynamicsTabPageState
physics: const AlwaysScrollableScrollPhysics(),
controller: controller.scrollController,
slivers: [
Obx(() => _buildBody(controller.loadingState.value)),
SliverPadding(
padding: EdgeInsets.only(
bottom: MediaQuery.paddingOf(context).bottom + 80,
),
sliver: Obx(() => _buildBody(controller.loadingState.value)),
),
],
),
);
@@ -134,57 +139,51 @@ class _DynamicsTabPageState
return switch (loadingState) {
Loading() => DynamicsTabPage.dynSkeleton(dynamicsWaterfallFlow),
Success(:var response) => response?.isNotEmpty == true
? SliverPadding(
padding: EdgeInsets.only(
bottom: MediaQuery.paddingOf(context).bottom + 80,
),
sliver: dynamicsWaterfallFlow
? SliverWaterfallFlow.extent(
maxCrossAxisExtent: Grid.smallCardWidth * 2,
crossAxisSpacing: StyleString.cardSpace / 2,
lastChildLayoutTypeBuilder: (index) {
if (index == response.length - 1) {
controller.onLoadMore();
}
return index == response.length
? LastChildLayoutType.foot
: LastChildLayoutType.none;
},
children: [
for (int index = 0; index < response!.length; index++)
DynamicPanel(
item: response[index],
? dynamicsWaterfallFlow
? SliverWaterfallFlow.extent(
maxCrossAxisExtent: Grid.smallCardWidth * 2,
crossAxisSpacing: StyleString.cardSpace / 2,
lastChildLayoutTypeBuilder: (index) {
if (index == response.length - 1) {
controller.onLoadMore();
}
return index == response.length
? LastChildLayoutType.foot
: LastChildLayoutType.none;
},
children: [
for (int index = 0; index < response!.length; index++)
DynamicPanel(
item: response[index],
onRemove: (idStr) => controller.onRemove(index, idStr),
onBlock: () => controller.onBlock(index),
)
],
)
: SliverCrossAxisGroup(
slivers: [
const SliverFillRemaining(),
SliverConstrainedCrossAxis(
maxExtent: Grid.smallCardWidth * 2,
sliver: SliverList.builder(
itemBuilder: (context, index) {
if (index == response.length - 1) {
controller.onLoadMore();
}
final item = response[index];
return DynamicPanel(
item: item,
onRemove: (idStr) =>
controller.onRemove(index, idStr),
onBlock: () => controller.onBlock(index),
)
],
)
: SliverCrossAxisGroup(
slivers: [
const SliverFillRemaining(),
SliverConstrainedCrossAxis(
maxExtent: Grid.smallCardWidth * 2,
sliver: SliverList.builder(
itemBuilder: (context, index) {
if (index == response.length - 1) {
controller.onLoadMore();
}
final item = response[index];
return DynamicPanel(
item: item,
onRemove: (idStr) =>
controller.onRemove(index, idStr),
onBlock: () => controller.onBlock(index),
);
},
itemCount: response!.length,
),
),
const SliverFillRemaining(),
],
);
},
itemCount: response!.length,
),
),
)
const SliverFillRemaining(),
],
)
: HttpError(
onReload: controller.onReload,
),