Add the textAlignVertical param to TextFormField (#39144)

This commit is contained in:
Justin McCandless 2019-08-27 19:08:35 -07:00 committed by GitHub
parent 80f96ee662
commit d3b70c91bf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 24 additions and 0 deletions

View File

@ -87,6 +87,7 @@ class TextFormField extends FormField<String> {
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<String> {
style: style,
strutStyle: strutStyle,
textAlign: textAlign,
textAlignVertical: textAlignVertical,
textDirection: textDirection,
textCapitalization: textCapitalization,
autofocus: autofocus,

View File

@ -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(