Skip to content

Commit e9e7005

Browse files
committed
fix bug:indicator too fast disappear when loadmore complete (temporary)
1 parent 99f8ad9 commit e9e7005

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

example/lib/ui/example/customindicator/footer_underscroll.dart

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
import 'package:flutter/material.dart';
1010
import 'package:flutter/widgets.dart';
11+
import 'package:flutter_gifimage/flutter_gifimage.dart';
1112
import 'package:pull_to_refresh/pull_to_refresh.dart';
1213

1314
import '../../Item.dart';

lib/src/internals/indicator_wrap.dart

+3
Original file line numberDiff line numberDiff line change
@@ -384,6 +384,9 @@ abstract class LoadIndicatorState<T extends LoadIndicator> extends State<T>
384384
return;
385385
}
386386

387+
// this line for patch bug temporary:indicator disappears fastly when load more complete
388+
if(mounted)
389+
Scrollable.of(context).position.correctBy(0.00001);
387390
WidgetsBinding.instance.addPostFrameCallback((_) {
388391
if (mounted && _position?.outOfRange == true) {
389392
activity.delegate.goBallistic(0);

lib/src/smart_refresher.dart

+3-2
Original file line numberDiff line numberDiff line change
@@ -737,17 +737,18 @@ class RefreshController {
737737
}
738738

739739
/// end twoLeveling,will return back first floor
740-
void twoLevelComplete(
740+
Future<void> twoLevelComplete(
741741
{Duration duration: const Duration(milliseconds: 500),
742742
Curve curve: Curves.linear}) {
743743
headerMode?.value = RefreshStatus.twoLevelClosing;
744744
WidgetsBinding.instance.addPostFrameCallback((_) {
745-
position
745+
return position
746746
.animateTo(0.0, duration: duration, curve: curve)
747747
.whenComplete(() {
748748
headerMode.value = RefreshStatus.idle;
749749
});
750750
});
751+
return null;
751752
}
752753

753754
/// request failed,the header display failed state

0 commit comments

Comments
 (0)