File tree 1 file changed +7
-3
lines changed
1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -97,11 +97,15 @@ void main() {
97
97
// ... and we fetch more messages as we go.
98
98
connection.prepare (json: olderResult (anchor: 950 , foundOldest: false ,
99
99
messages: List .generate (100 , (i) => eg.streamMessage (id: 850 + i, sender: eg.selfUser))).toJson ());
100
- await tester.pump (const Duration (milliseconds: 500 ));
101
- await tester.pump (Duration .zero);
100
+ for (int i = 0 ; i < 30 ; i++ ) {
101
+ // Find the point in the fling where the fetch starts.
102
+ await tester.pump (const Duration (milliseconds: 100 ));
103
+ if (itemCount (tester)! > 100 ) break ; // The loading indicator appeared.
104
+ }
105
+ await tester.pump (Duration .zero); // Allow a frame for the response to arrive.
102
106
check (itemCount (tester)).equals (200 );
103
107
104
- // But on the next frame, we promptly fetch *another* batch.
108
+ // On the next frame, we promptly fetch *another* batch.
105
109
// This is a glitch and it'd be nicer if we didn't.
106
110
connection.prepare (json: olderResult (anchor: 850 , foundOldest: false ,
107
111
messages: List .generate (100 , (i) => eg.streamMessage (id: 750 + i, sender: eg.selfUser))).toJson ());
You can’t perform that action at this time.
0 commit comments