From c13ed90c87b11059bf010d55094f8dd05dd7e573 Mon Sep 17 00:00:00 2001 From: Ian Hickson Date: Thu, 2 Nov 2017 12:19:58 -0700 Subject: [PATCH] TextStyle is not an enum (fixes crash with InputDecorator.toString) (#12835) --- .../lib/src/material/input_decorator.dart | 2 +- .../test/material/input_decorator_test.dart | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/packages/flutter/lib/src/material/input_decorator.dart b/packages/flutter/lib/src/material/input_decorator.dart index e4185c1772..c6f1614c29 100644 --- a/packages/flutter/lib/src/material/input_decorator.dart +++ b/packages/flutter/lib/src/material/input_decorator.dart @@ -408,7 +408,7 @@ class InputDecorator extends StatelessWidget { void debugFillProperties(DiagnosticPropertiesBuilder description) { super.debugFillProperties(description); description.add(new DiagnosticsProperty('decoration', decoration)); - description.add(new EnumProperty('baseStyle', baseStyle)); + description.add(new DiagnosticsProperty('baseStyle', baseStyle, defaultValue: null)); description.add(new DiagnosticsProperty('isFocused', isFocused)); description.add(new DiagnosticsProperty('isEmpty', isEmpty)); } diff --git a/packages/flutter/test/material/input_decorator_test.dart b/packages/flutter/test/material/input_decorator_test.dart index 6f873efe8d..c9c05fdc3a 100644 --- a/packages/flutter/test/material/input_decorator_test.dart +++ b/packages/flutter/test/material/input_decorator_test.dart @@ -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(), isFocused: false, isEmpty: false)', + ); + }); }