Update text_form_field.dart (#15843)

* Update text_form_field.dart

* Update text_form_field_test.dart

* Update text_form_field_test.dart

* Update text_form_field_test.dart
diff --git a/packages/flutter/lib/src/material/text_form_field.dart b/packages/flutter/lib/src/material/text_form_field.dart
index 86de88c..0181c55 100644
--- a/packages/flutter/lib/src/material/text_form_field.dart
+++ b/packages/flutter/lib/src/material/text_form_field.dart
@@ -60,6 +60,7 @@
     bool autofocus: false,
     bool obscureText: false,
     bool autocorrect: true,
+    bool autovalidate: false,
     bool maxLengthEnforced: true,
     int maxLines: 1,
     int maxLength,
@@ -74,6 +75,7 @@
        assert(autofocus != null),
        assert(obscureText != null),
        assert(autocorrect != null),
+       assert(autovalidate != null),
        assert(maxLengthEnforced != null),
        assert(maxLines == null || maxLines > 0),
        assert(maxLength == null || maxLength > 0),
@@ -82,6 +84,7 @@
     initialValue: controller != null ? controller.text : (initialValue ?? ''),
     onSaved: onSaved,
     validator: validator,
+    autovalidate: autovalidate,
     builder: (FormFieldState<String> field) {
       final _TextFormFieldState state = field;
       final InputDecoration effectiveDecoration = (decoration ?? const InputDecoration())
diff --git a/packages/flutter/test/material/text_form_field_test.dart b/packages/flutter/test/material/text_form_field_test.dart
index 921905d..872455c 100644
--- a/packages/flutter/test/material/text_form_field_test.dart
+++ b/packages/flutter/test/material/text_form_field_test.dart
@@ -49,4 +49,27 @@
     await tester.pump();
     expect(_called, true);
   });
+  
+  testWidgets('autovalidate is passed to super', (WidgetTester tester) async {
+    int _validateCalled = 0;
+
+    await tester.pumpWidget(
+      new MaterialApp(
+        home: new Material(
+          child: new Center(
+            child: new TextFormField(
+              autovalidate: true,
+              validator: (String value) { _validateCalled++; return null; },
+            ),
+          ),
+        ),
+      ),
+    );
+
+    expect(_validateCalled, 1);
+    await tester.showKeyboard(find.byType(TextField));
+    await tester.enterText(find.byType(TextField), 'a');
+    await tester.pump();
+    expect(_validateCalled, 2);
+  });
 }