mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-04-23 20:12:35 +08:00
@@ -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!,
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user