mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-04-27 13:55:54 +08:00
@@ -99,7 +99,7 @@ abstract final class RequestUtils {
|
||||
required BuildContext context,
|
||||
required dynamic mid,
|
||||
required bool isFollow,
|
||||
required ValueChanged<int>? callback,
|
||||
required ValueChanged<int>? afterMod,
|
||||
Map? followStatus,
|
||||
}) async {
|
||||
if (mid == null) {
|
||||
@@ -114,7 +114,7 @@ abstract final class RequestUtils {
|
||||
);
|
||||
if (res.isSuccess) {
|
||||
SmartDialog.showToast('关注成功');
|
||||
callback?.call(2);
|
||||
afterMod?.call(2);
|
||||
} else {
|
||||
res.toast();
|
||||
}
|
||||
@@ -151,7 +151,7 @@ abstract final class RequestUtils {
|
||||
);
|
||||
if (res.isSuccess) {
|
||||
SmartDialog.showToast('$text成功');
|
||||
callback?.call(isSpecialFollowed ? 2 : -10);
|
||||
afterMod?.call(isSpecialFollowed ? 2 : -10);
|
||||
} else {
|
||||
res.toast();
|
||||
}
|
||||
@@ -196,7 +196,7 @@ abstract final class RequestUtils {
|
||||
);
|
||||
followStatus!['tag'] = result?.toList();
|
||||
if (result != null) {
|
||||
callback?.call(result.contains(-10) ? -10 : 2);
|
||||
afterMod?.call(result.contains(-10) ? -10 : 2);
|
||||
}
|
||||
},
|
||||
title: const Text(
|
||||
@@ -215,7 +215,7 @@ abstract final class RequestUtils {
|
||||
);
|
||||
if (res.isSuccess) {
|
||||
SmartDialog.showToast('取消关注成功');
|
||||
callback?.call(0);
|
||||
afterMod?.call(0);
|
||||
} else {
|
||||
res.toast();
|
||||
}
|
||||
|
||||
@@ -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