Skip to content

Commit a65737f

Browse files
committed
调整下拉动画
1 parent 6132998 commit a65737f

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

lib/widget/pull/gsy_flare_pull_controller.dart

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ mixin GSYFlarePullController implements FlareController {
66
ActorAnimation _pullAnimation;
77

88
double pulledExtentFlare = 0;
9-
double _refreshTriggerPullDistance = 140;
109
double _speed = 2.0;
1110
double _rockTime = 0.0;
1211

@@ -25,12 +24,17 @@ mixin GSYFlarePullController implements FlareController {
2524
_pullAnimation.apply(_rockTime % _pullAnimation.duration, artboard, 1.0);
2625
return true;
2726
}
28-
double animationPosition = pulledExtentFlare / _refreshTriggerPullDistance;
27+
var pullExtent = (pulledExtentFlare > refreshTriggerPullDistance)
28+
? pulledExtentFlare - refreshTriggerPullDistance
29+
: pulledExtentFlare;
30+
double animationPosition = pullExtent / refreshTriggerPullDistance;
2931
animationPosition *= animationPosition;
3032
_rockTime = _pullAnimation.duration * animationPosition;
3133
_pullAnimation.apply(_rockTime, artboard, 1.0);
3234
return true;
3335
}
3436

3537
bool get getPlayAuto;
38+
39+
double get refreshTriggerPullDistance => 140;
3640
}

lib/widget/pull/gsy_pull_new_load_widget.dart

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,9 @@ class _GSYPullLoadWidgetState extends State<GSYPullLoadWidget>
300300
@override
301301
bool get getPlayAuto => playAuto;
302302

303+
@override
304+
double get refreshTriggerPullDistance => iosRefreshHeight;
305+
303306
Widget buildSimpleRefreshIndicator(
304307
BuildContext context,
305308
IOS.RefreshIndicatorMode refreshState,

0 commit comments

Comments
 (0)