Unverified Commit a2d1d27f authored by Michael Goderbauer's avatar Michael Goderbauer Committed by GitHub

Keep indeterminate RefreshProgressIndicator spinning until end of time (#18010)

parent 921695cc
...@@ -528,8 +528,8 @@ class _RefreshProgressIndicatorState extends _CircularProgressIndicatorState { ...@@ -528,8 +528,8 @@ class _RefreshProgressIndicatorState extends _CircularProgressIndicatorState {
Widget build(BuildContext context) { Widget build(BuildContext context) {
if (widget.value != null) if (widget.value != null)
_controller.value = widget.value / 10.0; _controller.value = widget.value / 10.0;
else else if (!_controller.isAnimating)
_controller.forward(); _controller.repeat();
return _buildAnimation(); return _buildAnimation();
} }
......
...@@ -206,4 +206,30 @@ void main() { ...@@ -206,4 +206,30 @@ void main() {
expect(find.byType(CircularProgressIndicator), paints..arc(strokeWidth: 16.0)); expect(find.byType(CircularProgressIndicator), paints..arc(strokeWidth: 16.0));
}); });
testWidgets('Indeterminate RefreshProgressIndicator keeps spinning until end of time (approximate)', (WidgetTester tester) async {
// Regression test for https://github.com/flutter/flutter/issues/13782
await tester.pumpWidget(
const Directionality(
textDirection: TextDirection.ltr,
child: const Center(
child: const SizedBox(
width: 200.0,
child: const RefreshProgressIndicator(),
),
),
),
);
expect(tester.hasRunningAnimations, isTrue);
await tester.pump(const Duration(milliseconds: 6666));
expect(tester.hasRunningAnimations, isTrue);
await tester.pump(const Duration(milliseconds: 1));
expect(tester.hasRunningAnimations, isTrue);
await tester.pump(const Duration(days: 9999));
expect(tester.hasRunningAnimations, isTrue);
});
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment