TextStyle is not an enum (fixes crash with InputDecorator.toString) (#12835)
This commit is contained in:
@@ -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)',
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user