This commit is contained in:
Hans Muller
2018-04-26 10:29:44 -07:00
committed by GitHub
parent d8f2f36935
commit e62a6451f7
2 changed files with 23 additions and 1 deletions

View File

@@ -364,7 +364,8 @@ class _TextFieldState extends State<TextField> with AutomaticKeepAliveClientMixi
InteractiveInkFeature _createInkFeature(TapDownDetails details) {
final MaterialInkController inkController = Material.of(context);
final RenderBox referenceBox = InputDecorator.containerOf(_editableTextKey.currentContext);
final BuildContext editableContext = _editableTextKey.currentContext;
final RenderBox referenceBox = InputDecorator.containerOf(editableContext) ?? editableContext.findRenderObject();
final Offset position = referenceBox.globalToLocal(details.globalPosition);
final Color color = Theme.of(context).splashColor;

View File

@@ -206,4 +206,25 @@ void main() {
await tester.pump(); // in case the AutomaticKeepAlive widget thinks it needs a cleanup frame
expect(find.byType(TextField), findsOneWidget);
});
testWidgets('TextField with decoration:null', (WidgetTester tester) async {
// Regression test for https://github.com/flutter/flutter/issues/16880
await tester.pumpWidget(
new MaterialApp(
home: const Material(
child: const Center(
child: const TextField(
decoration: null
),
),
),
),
);
expect(tester.testTextInput.isVisible, isFalse);
await tester.tap(find.byType(TextField));
await tester.idle();
expect(tester.testTextInput.isVisible, isTrue);
});
}