Added size to stepper icons (#19313)
* Added size to stepper icons * Added Stepper icons size test
This commit is contained in:
committed by
Ian Hickson
parent
2ab4ed748e
commit
1658fd9412
@@ -242,11 +242,13 @@ class _StepperState extends State<Stepper> with TickerProviderStateMixin {
|
||||
return new Icon(
|
||||
Icons.edit,
|
||||
color: isDarkActive ? _kCircleActiveDark : _kCircleActiveLight,
|
||||
size: 18.0,
|
||||
);
|
||||
case StepState.complete:
|
||||
return new Icon(
|
||||
Icons.check,
|
||||
color: isDarkActive ? _kCircleActiveDark : _kCircleActiveLight,
|
||||
size: 18.0,
|
||||
);
|
||||
case StepState.error:
|
||||
return const Text('!', style: _kStepStyle);
|
||||
|
||||
@@ -392,4 +392,34 @@ void main() {
|
||||
|
||||
expect(find.text('!'), findsOneWidget);
|
||||
});
|
||||
|
||||
///https://github.com/flutter/flutter/issues/16920
|
||||
testWidgets('Stepper icons size test', (WidgetTester tester) async {
|
||||
await tester.pumpWidget(
|
||||
new MaterialApp(
|
||||
home: Material(
|
||||
child: new Stepper(
|
||||
steps: const <Step>[
|
||||
const Step(
|
||||
title: const Text('A'),
|
||||
state: StepState.editing,
|
||||
content: const SizedBox(width: 100.0, height: 100.0),
|
||||
),
|
||||
const Step(
|
||||
title: const Text('B'),
|
||||
state: StepState.complete,
|
||||
content: const SizedBox(width: 100.0, height: 100.0),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
RenderBox renderObject = tester.renderObject(find.byIcon(Icons.edit));
|
||||
expect(renderObject.size, equals(const Size.square(18.0)));
|
||||
|
||||
renderObject = tester.renderObject(find.byIcon(Icons.check));
|
||||
expect(renderObject.size, equals(const Size.square(18.0)));
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user