From d3b70c91bf337315b61f34795057c8d734e23ec9 Mon Sep 17 00:00:00 2001 From: Justin McCandless Date: Tue, 27 Aug 2019 19:08:35 -0700 Subject: [PATCH] Add the textAlignVertical param to TextFormField (#39144) --- .../lib/src/material/text_form_field.dart | 2 ++ .../test/material/text_form_field_test.dart | 22 +++++++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/packages/flutter/lib/src/material/text_form_field.dart b/packages/flutter/lib/src/material/text_form_field.dart index 3cc3aaa9ec..30cef410a8 100644 --- a/packages/flutter/lib/src/material/text_form_field.dart +++ b/packages/flutter/lib/src/material/text_form_field.dart @@ -87,6 +87,7 @@ class TextFormField extends FormField { StrutStyle strutStyle, TextDirection textDirection, TextAlign textAlign = TextAlign.start, + TextAlignVertical textAlignVertical, bool autofocus = false, bool readOnly = false, ToolbarOptions toolbarOptions, @@ -162,6 +163,7 @@ class TextFormField extends FormField { style: style, strutStyle: strutStyle, textAlign: textAlign, + textAlignVertical: textAlignVertical, textDirection: textDirection, textCapitalization: textCapitalization, autofocus: autofocus, diff --git a/packages/flutter/test/material/text_form_field_test.dart b/packages/flutter/test/material/text_form_field_test.dart index 622eeb73be..f2fc8d8cb2 100644 --- a/packages/flutter/test/material/text_form_field_test.dart +++ b/packages/flutter/test/material/text_form_field_test.dart @@ -32,6 +32,28 @@ void main() { expect(textFieldWidget.textAlign, alignment); }); + testWidgets('Passes textAlignVertical to underlying TextField', (WidgetTester tester) async { + const TextAlignVertical textAlignVertical = TextAlignVertical.bottom; + + await tester.pumpWidget( + MaterialApp( + home: Material( + child: Center( + child: TextFormField( + textAlignVertical: textAlignVertical, + ), + ), + ), + ), + ); + + final Finder textFieldFinder = find.byType(TextField); + expect(textFieldFinder, findsOneWidget); + + final TextField textFieldWidget = tester.widget(textFieldFinder); + expect(textFieldWidget.textAlignVertical, textAlignVertical); + }); + testWidgets('Passes textInputAction to underlying TextField', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp(