diff --git a/packages/flutter/lib/src/material/progress_indicator.dart b/packages/flutter/lib/src/material/progress_indicator.dart index 6ea6d6f814..9335a3e3ad 100644 --- a/packages/flutter/lib/src/material/progress_indicator.dart +++ b/packages/flutter/lib/src/material/progress_indicator.dart @@ -304,7 +304,7 @@ class LinearProgressIndicator extends ProgressIndicator { Key? key, double? value, Color? backgroundColor, - Animation? valueColor, + Animation? valueColor, this.minHeight, String? semanticsLabel, String? semanticsValue, diff --git a/packages/flutter/test/material/progress_indicator_test.dart b/packages/flutter/test/material/progress_indicator_test.dart index 55fec928d4..9a667dec34 100644 --- a/packages/flutter/test/material/progress_indicator_test.dart +++ b/packages/flutter/test/material/progress_indicator_test.dart @@ -196,6 +196,31 @@ void main() { ); }); + testWidgets('LinearProgressIndicator with animation with null colors', (WidgetTester tester) async { + await tester.pumpWidget( + const Directionality( + textDirection: TextDirection.ltr, + child: Center( + child: SizedBox( + width: 200.0, + child: LinearProgressIndicator( + value: 0.25, + valueColor: AlwaysStoppedAnimation(null), + backgroundColor: Colors.black, + ), + ), + ), + ), + ); + + expect( + find.byType(LinearProgressIndicator), + paints + ..rect(rect: const Rect.fromLTRB(0.0, 0.0, 200.0, 4.0)) + ..rect(rect: const Rect.fromLTRB(0.0, 0.0, 50.0, 4.0)), + ); + }); + testWidgets('CircularProgressIndicator(value: 0.0) can be constructed and has value semantics by default', (WidgetTester tester) async { final SemanticsHandle handle = tester.ensureSemantics(); await tester.pumpWidget(