Unverified Commit 3ddd77de authored by Miguel Beltran's avatar Miguel Beltran Committed by GitHub

Fix for #75792 - allow use of Animator<Color?> with LinearProgressIndicator (#75794)

parent b1cc4874
......@@ -304,7 +304,7 @@ class LinearProgressIndicator extends ProgressIndicator {
Key? key,
double? value,
Color? backgroundColor,
Animation<Color>? valueColor,
Animation<Color?>? valueColor,
this.minHeight,
String? semanticsLabel,
String? semanticsValue,
......
......@@ -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<Color?>(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(
......
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