Fix LinearProgressIndicator constructor (#12282)
* Update AUTHORS * Add background and value colors to LinearProgressIndicator * Add tests for LinearProgressIndicator with colors
This commit is contained in:
parent
ce59412cf2
commit
dca164ab2d
1
AUTHORS
1
AUTHORS
@ -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 {
|
|||||||
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() {
|
|||||||
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(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user