Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-12-17 12:43:09 +08:00
parent ab1e5cb62a
commit b4fb7d14d4
31 changed files with 84 additions and 85 deletions

View File

@@ -14,7 +14,7 @@ mixin DynMixin {
SliverWaterfallFlowDelegateWithMaxCrossAxisExtent(
maxCrossAxisExtent: Grid.smallCardWidth * 2,
crossAxisSpacing: 4,
callback: (value) => maxWidth = value,
afterCalc: (value) => maxWidth = value,
);
Widget buildPage(Widget child) {
@@ -79,7 +79,7 @@ class SliverWaterfallFlowDelegateWithMaxCrossAxisExtent
super.collectGarbage,
super.viewportBuilder,
super.closeToTrailing,
this.callback,
this.afterCalc,
}) : assert(maxCrossAxisExtent >= 0);
/// The maximum extent of tiles in the cross axis.
@@ -98,7 +98,7 @@ class SliverWaterfallFlowDelegateWithMaxCrossAxisExtent
int? crossAxisCount;
double? crossAxisExtent;
final ValueChanged<double>? callback;
final ValueChanged<double>? afterCalc;
@override
int getCrossAxisCount(SliverConstraints constraints) {
@@ -109,7 +109,7 @@ class SliverWaterfallFlowDelegateWithMaxCrossAxisExtent
this.crossAxisExtent = crossAxisExtent;
crossAxisCount = (crossAxisExtent / (maxCrossAxisExtent + crossAxisSpacing))
.ceil();
callback?.call(
afterCalc?.call(
(crossAxisExtent - ((crossAxisCount! - 1) * crossAxisSpacing)) /
crossAxisCount!,
);