Commit dca164ab authored by Stefano Rodriguez's avatar Stefano Rodriguez Committed by gspencergoog

Fix LinearProgressIndicator constructor (#12282)

* Update AUTHORS

* Add background and value colors to LinearProgressIndicator

* Add tests for LinearProgressIndicator with colors
parent ce59412c
...@@ -16,3 +16,4 @@ Luke Freeman <luke@goposse.com> ...@@ -16,3 +16,4 @@ Luke Freeman <luke@goposse.com>
Vincent Le Quéméner <eu.lequem@gmail.com> Vincent Le Quéméner <eu.lequem@gmail.com>
Mike Hoolehan <mike@hoolehan.com> Mike Hoolehan <mike@hoolehan.com>
German Saprykin <saprykin.h@gmail.com> German Saprykin <saprykin.h@gmail.com>
Stefano Rodriguez <hlsroddy@gmail.com>
...@@ -161,7 +161,9 @@ class LinearProgressIndicator extends ProgressIndicator { ...@@ -161,7 +161,9 @@ class LinearProgressIndicator extends ProgressIndicator {
const LinearProgressIndicator({ const LinearProgressIndicator({
Key key, Key key,
double value, double value,
}) : super(key: key, value: value); Color backgroundColor,
Animation<Color> valueColor,
}) : super(key: key, value: value, backgroundColor: backgroundColor, valueColor: valueColor);
@override @override
_LinearProgressIndicatorState createState() => new _LinearProgressIndicatorState(); _LinearProgressIndicatorState createState() => new _LinearProgressIndicatorState();
......
...@@ -143,6 +143,31 @@ void main() { ...@@ -143,6 +143,31 @@ void main() {
expect(tester.binding.transientCallbackCount, 1); expect(tester.binding.transientCallbackCount, 1);
}); });
testWidgets('LinearProgressIndicator with colors', (WidgetTester tester) async {
await tester.pumpWidget(
const Directionality(
textDirection: TextDirection.ltr,
child: const Center(
child: const SizedBox(
width: 200.0,
child: const LinearProgressIndicator(
value: 0.25,
valueColor: const AlwaysStoppedAnimation<Color>(Colors.white),
backgroundColor: Colors.black,
),
),
),
),
);
expect(
find.byType(LinearProgressIndicator),
paints
..rect(rect: new Rect.fromLTRB(0.0, 0.0, 200.0, 6.0))
..rect(rect: new Rect.fromLTRB(0.0, 0.0, 50.0, 6.0), color: Colors.white)
);
});
testWidgets('CircularProgressIndicator(value: 0.0) can be constructed', (WidgetTester tester) async { testWidgets('CircularProgressIndicator(value: 0.0) can be constructed', (WidgetTester tester) async {
await tester.pumpWidget( await tester.pumpWidget(
const Center( const Center(
......
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