@@ -1070,4 +1070,53 @@ void main() {
10701070
10711071 expect (fakeRefresh.called, isTrue);
10721072 });
1073+
1074+ testWidgets (
1075+ 'CustomRefreshIndicator - BouncingPhysics - start from scroll update notification' ,
1076+ (WidgetTester tester) async {
1077+ final indicatorController = IndicatorController ();
1078+ final scrollController = ScrollController (initialScrollOffset: 0 );
1079+ await tester.pumpWidget (
1080+ MaterialApp (
1081+ home: CustomRefreshIndicator (
1082+ controller: indicatorController,
1083+ builder: buildWithoutIndicator,
1084+ trigger: IndicatorTrigger .bothEdges,
1085+ onRefresh: fakeRefresh.instantRefresh,
1086+ child: DefaultList (
1087+ itemsCount: 1 ,
1088+ controller: scrollController,
1089+ physics: const AlwaysScrollableScrollPhysics (
1090+ parent: BouncingScrollPhysics ()),
1091+ ),
1092+ ),
1093+ ),
1094+ );
1095+
1096+ // start edge
1097+ await tester.fling (find.text ('1' ), const Offset (0.0 , 300.0 ), 1000.0 );
1098+ await tester.pump ();
1099+ // finish the scroll animation
1100+ await tester.pump (const Duration (seconds: 1 ));
1101+ // wait for complete state
1102+ await tester.pump (const Duration (seconds: 1 ));
1103+ // finish the indicator
1104+ await tester.pump (const Duration (seconds: 1 ));
1105+
1106+ expect (fakeRefresh.called, isTrue);
1107+ fakeRefresh.reset ();
1108+ expect (fakeRefresh.called, isFalse);
1109+
1110+ // end edge
1111+ await tester.fling (find.text ('1' ), const Offset (0.0 , - 300.0 ), 1000.0 );
1112+ await tester.pump ();
1113+ // finish the scroll animation
1114+ await tester.pump (const Duration (seconds: 1 ));
1115+ // wait for complete state
1116+ await tester.pump (const Duration (seconds: 1 ));
1117+ // finish the indicator
1118+ await tester.pump (const Duration (seconds: 1 ));
1119+
1120+ expect (fakeRefresh.called, isTrue);
1121+ });
10731122}
0 commit comments