Unverified Commit c13ed90c authored by Ian Hickson's avatar Ian Hickson Committed by GitHub

TextStyle is not an enum (fixes crash with InputDecorator.toString) (#12835)

parent d402d40a
......@@ -408,7 +408,7 @@ class InputDecorator extends StatelessWidget {
void debugFillProperties(DiagnosticPropertiesBuilder description) {
super.debugFillProperties(description);
description.add(new DiagnosticsProperty<InputDecoration>('decoration', decoration));
description.add(new EnumProperty<TextStyle>('baseStyle', baseStyle));
description.add(new DiagnosticsProperty<TextStyle>('baseStyle', baseStyle, defaultValue: null));
description.add(new DiagnosticsProperty<bool>('isFocused', isFocused));
description.add(new DiagnosticsProperty<bool>('isEmpty', isEmpty));
}
......
......@@ -420,4 +420,20 @@ void main() {
expect(tester.getRect(find.text('S')).left, anyOf(783.0, 784.0));
expect(tester.getRect(find.text('S')).top, equals(295.5));
});
testWidgets('InputDecorator animates properly', (WidgetTester tester) async {
final Widget child = const InputDecorator(
key: const Key('key'),
decoration: const InputDecoration(),
baseStyle: const TextStyle(),
textAlign: TextAlign.center,
isFocused: false,
isEmpty: false,
child: const Placeholder(),
);
expect(
child.toString(),
'InputDecorator-[<\'key\'>](decoration: InputDecoration(), baseStyle: TextStyle(<all styles inherited>), isFocused: false, isEmpty: false)',
);
});
}
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