mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-05-21 08:38:37 +00:00
@@ -10,11 +10,12 @@ import 'package:waterfall_flow/waterfall_flow.dart'
|
||||
mixin DynMixin {
|
||||
late double maxWidth;
|
||||
|
||||
late final gridDelegate = SliverWaterfallFlowDelegateWithMaxCrossAxisExtent(
|
||||
maxCrossAxisExtent: Grid.smallCardWidth * 2,
|
||||
crossAxisSpacing: 4,
|
||||
callback: (value) => maxWidth = value,
|
||||
);
|
||||
late final dynGridDelegate =
|
||||
SliverWaterfallFlowDelegateWithMaxCrossAxisExtent(
|
||||
maxCrossAxisExtent: Grid.smallCardWidth * 2,
|
||||
crossAxisSpacing: 4,
|
||||
callback: (value) => maxWidth = value,
|
||||
);
|
||||
|
||||
late final skeDelegate = SliverGridDelegateWithExtentAndRatio(
|
||||
crossAxisSpacing: 4,
|
||||
@@ -25,27 +26,25 @@ mixin DynMixin {
|
||||
);
|
||||
|
||||
Widget get dynSkeleton {
|
||||
if (!GlobalData().dynamicsWaterfallFlow) {
|
||||
return SliverCrossAxisGroup(
|
||||
slivers: [
|
||||
const SliverFillRemaining(),
|
||||
SliverConstrainedCrossAxis(
|
||||
maxExtent: Grid.smallCardWidth * 2,
|
||||
sliver: SliverList.builder(
|
||||
itemBuilder: (_, _) => const DynamicCardSkeleton(),
|
||||
itemCount: 10,
|
||||
),
|
||||
),
|
||||
const SliverFillRemaining(),
|
||||
],
|
||||
if (GlobalData().dynamicsWaterfallFlow) {
|
||||
return SliverGrid.builder(
|
||||
gridDelegate: skeDelegate,
|
||||
itemBuilder: (_, _) => const DynamicCardSkeleton(),
|
||||
itemCount: 10,
|
||||
);
|
||||
}
|
||||
return SliverGrid(
|
||||
gridDelegate: skeDelegate,
|
||||
delegate: SliverChildBuilderDelegate(
|
||||
(_, _) => const DynamicCardSkeleton(),
|
||||
childCount: 10,
|
||||
),
|
||||
return SliverCrossAxisGroup(
|
||||
slivers: [
|
||||
const SliverFillRemaining(),
|
||||
SliverConstrainedCrossAxis(
|
||||
maxExtent: Grid.smallCardWidth * 2,
|
||||
sliver: SliverList.builder(
|
||||
itemBuilder: (_, _) => const DynamicCardSkeleton(),
|
||||
itemCount: 10,
|
||||
),
|
||||
),
|
||||
const SliverFillRemaining(),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user