Unverified Commit 45d01c95 authored by Kate Lovett's avatar Kate Lovett Committed by GitHub

Add fixes for autovalidate deprecation in Form, FormField, TextFormField, and...

Add fixes for autovalidate deprecation in Form, FormField, TextFormField, and DropdownButtonFormField (#73996)
parent 54ef030a
...@@ -11,6 +11,168 @@ ...@@ -11,6 +11,168 @@
version: 1 version: 1
transforms: transforms:
# Changes made in https://github.com/flutter/flutter/pull/61648
- title: 'Migrate to autovalidateMode'
date: 2020-09-02
element:
uris: [ 'widgets.dart', 'material.dart', 'cupertino.dart' ]
field: 'autovalidate'
inClass: 'Form'
changes:
- kind: 'rename'
newName: 'autovalidateMode'
# Changes made in https://github.com/flutter/flutter/pull/61648
- title: 'Migrate to autovalidateMode'
date: 2020-09-02
element:
uris: [ 'widgets.dart', 'material.dart', 'cupertino.dart' ]
constructor: ''
inClass: 'Form'
oneOf:
- if: "autovalidate == 'true'"
changes:
- kind: 'addParameter'
index: 0
name: 'autovalidateMode'
style: optional_named
argumentValue:
expression: 'AutoValidateMode.always'
requiredIf: "autovalidate == 'true'"
- kind: 'removeParameter'
name: 'autovalidate'
- if: "autovalidate == 'false'"
changes:
- kind: 'addParameter'
index: 0
name: 'autovalidateMode'
style: optional_named
argumentValue:
expression: 'AutoValidateMode.disabled'
requiredIf: "autovalidate == 'false'"
- kind: 'removeParameter'
name: 'autovalidate'
variables:
autovalidate:
kind: 'fragment'
value: 'arguments[autovalidate]'
# Changes made in https://github.com/flutter/flutter/pull/61648
- title: 'Migrate to autovalidateMode'
date: 2020-09-02
element:
uris: [ 'widgets.dart', 'material.dart', 'cupertino.dart' ]
field: 'autovalidate'
inClass: 'FormField'
changes:
- kind: 'rename'
newName: 'autovalidateMode'
# Changes made in https://github.com/flutter/flutter/pull/61648
- title: 'Migrate to autovalidateMode'
date: 2020-09-02
element:
uris: [ 'widgets.dart', 'material.dart', 'cupertino.dart' ]
constructor: ''
inClass: 'FormField'
oneOf:
- if: "autovalidate == 'true'"
changes:
- kind: 'addParameter'
index: 0
name: 'autovalidateMode'
style: optional_named
argumentValue:
expression: 'AutoValidateMode.always'
requiredIf: "autovalidate == 'true'"
- kind: 'removeParameter'
name: 'autovalidate'
- if: "autovalidate == 'false'"
changes:
- kind: 'addParameter'
index: 0
name: 'autovalidateMode'
style: optional_named
argumentValue:
expression: 'AutoValidateMode.disabled'
requiredIf: "autovalidate == 'false'"
- kind: 'removeParameter'
name: 'autovalidate'
variables:
autovalidate:
kind: 'fragment'
value: 'arguments[autovalidate]'
# Changes made in https://github.com/flutter/flutter/pull/61648
- title: 'Migrate to autovalidateMode'
date: 2020-09-02
element:
uris: [ 'material.dart' ]
constructor: ''
inClass: 'TextFormField'
oneOf:
- if: "autovalidate == 'true'"
changes:
- kind: 'addParameter'
index: 0
name: 'autovalidateMode'
style: optional_named
argumentValue:
expression: 'AutoValidateMode.always'
requiredIf: "autovalidate == 'true'"
- kind: 'removeParameter'
name: 'autovalidate'
- if: "autovalidate == 'false'"
changes:
- kind: 'addParameter'
index: 0
name: 'autovalidateMode'
style: optional_named
argumentValue:
expression: 'AutoValidateMode.disabled'
requiredIf: "autovalidate == 'false'"
- kind: 'removeParameter'
name: 'autovalidate'
variables:
autovalidate:
kind: 'fragment'
value: 'arguments[autovalidate]'
# Changes made in https://github.com/flutter/flutter/pull/61648
- title: 'Migrate to autovalidateMode'
date: 2020-09-02
element:
uris: [ 'material.dart' ]
constructor: ''
inClass: 'DropdownButtonFormField'
oneOf:
- if: "autovalidate == 'true'"
changes:
- kind: 'addParameter'
index: 0
name: 'autovalidateMode'
style: optional_named
argumentValue:
expression: 'AutoValidateMode.always'
requiredIf: "autovalidate == 'true'"
- kind: 'removeParameter'
name: 'autovalidate'
- if: "autovalidate == 'false'"
changes:
- kind: 'addParameter'
index: 0
name: 'autovalidateMode'
style: optional_named
argumentValue:
expression: 'AutoValidateMode.disabled'
requiredIf: "autovalidate == 'false'"
- kind: 'removeParameter'
name: 'autovalidate'
variables:
autovalidate:
kind: 'fragment'
value: 'arguments[autovalidate]'
# Changes made in https://github.com/flutter/flutter/pull/48547 # Changes made in https://github.com/flutter/flutter/pull/48547
- title: 'Renamed to headline1' - title: 'Renamed to headline1'
date: 2020-01-24 date: 2020-01-24
......
...@@ -1471,7 +1471,7 @@ class DropdownButtonFormField<T> extends FormField<T> { ...@@ -1471,7 +1471,7 @@ class DropdownButtonFormField<T> extends FormField<T> {
FormFieldSetter<T>? onSaved, FormFieldSetter<T>? onSaved,
FormFieldValidator<T>? validator, FormFieldValidator<T>? validator,
@Deprecated( @Deprecated(
'Use autoValidateMode parameter which provide more specific ' 'Use autovalidateMode parameter which provide more specific '
'behaviour related to auto validation. ' 'behaviour related to auto validation. '
'This feature was deprecated after v1.19.0.' 'This feature was deprecated after v1.19.0.'
) )
......
...@@ -157,7 +157,7 @@ class TextFormField extends FormField<String> { ...@@ -157,7 +157,7 @@ class TextFormField extends FormField<String> {
SmartQuotesType? smartQuotesType, SmartQuotesType? smartQuotesType,
bool enableSuggestions = true, bool enableSuggestions = true,
@Deprecated( @Deprecated(
'Use autoValidateMode parameter which provide more specific ' 'Use autovalidateMode parameter which provide more specific '
'behaviour related to auto validation. ' 'behaviour related to auto validation. '
'This feature was deprecated after v1.19.0.' 'This feature was deprecated after v1.19.0.'
) )
......
...@@ -77,7 +77,7 @@ class Form extends StatefulWidget { ...@@ -77,7 +77,7 @@ class Form extends StatefulWidget {
Key? key, Key? key,
required this.child, required this.child,
@Deprecated( @Deprecated(
'Use autoValidateMode parameter which provides more specific ' 'Use autovalidateMode parameter which provides more specific '
'behavior related to auto validation. ' 'behavior related to auto validation. '
'This feature was deprecated after v1.19.0.' 'This feature was deprecated after v1.19.0.'
) )
...@@ -143,7 +143,7 @@ class Form extends StatefulWidget { ...@@ -143,7 +143,7 @@ class Form extends StatefulWidget {
/// Used to enable/disable form fields auto validation and update their error /// Used to enable/disable form fields auto validation and update their error
/// text. /// text.
@Deprecated( @Deprecated(
'Use autoValidateMode parameter which provides more specific ' 'Use autovalidateMode parameter which provides more specific '
'behavior related to auto validation. ' 'behavior related to auto validation. '
'This feature was deprecated after v1.19.0.' 'This feature was deprecated after v1.19.0.'
) )
...@@ -326,7 +326,7 @@ class FormField<T> extends StatefulWidget { ...@@ -326,7 +326,7 @@ class FormField<T> extends StatefulWidget {
this.validator, this.validator,
this.initialValue, this.initialValue,
@Deprecated( @Deprecated(
'Use autoValidateMode parameter which provides more specific ' 'Use autovalidateMode parameter which provides more specific '
'behavior related to auto validation. ' 'behavior related to auto validation. '
'This feature was deprecated after v1.19.0.' 'This feature was deprecated after v1.19.0.'
) )
...@@ -395,7 +395,7 @@ class FormField<T> extends StatefulWidget { ...@@ -395,7 +395,7 @@ class FormField<T> extends StatefulWidget {
/// Used to enable/disable auto validation and update their error /// Used to enable/disable auto validation and update their error
/// text. /// text.
@Deprecated( @Deprecated(
'Use autoValidateMode parameter which provides more specific ' 'Use autovalidateMode parameter which provides more specific '
'behavior related to auto validation. ' 'behavior related to auto validation. '
'This feature was deprecated after v1.19.0.' 'This feature was deprecated after v1.19.0.'
) )
......
...@@ -27,4 +27,14 @@ void main() { ...@@ -27,4 +27,14 @@ void main() {
buildContext.ancestorStateOfType(TypeMatcher<targetType>()); buildContext.ancestorStateOfType(TypeMatcher<targetType>());
buildContext.rootAncestorStateOfType(TypeMatcher<targetType>()); buildContext.rootAncestorStateOfType(TypeMatcher<targetType>());
buildContext.ancestorRenderObjectOfType(TypeMatcher<targetType>()); buildContext.ancestorRenderObjectOfType(TypeMatcher<targetType>());
// Changes made in https://github.com/flutter/flutter/pull/61648
const Form form = Form(autovalidate: true);
const Form form = Form(autovalidate: false);
final autoMode = form.autovalidate;
// Changes made in https://github.com/flutter/flutter/pull/61648
const FormField formField = FormField(autovalidate: true);
const FormField formField = FormField(autovalidate: false);
final autoMode = formField.autovalidate;
} }
...@@ -27,4 +27,14 @@ void main() { ...@@ -27,4 +27,14 @@ void main() {
buildContext.findAncestorStateOfType<targetType>(); buildContext.findAncestorStateOfType<targetType>();
buildContext.findRootAncestorStateOfType<targetType>(); buildContext.findRootAncestorStateOfType<targetType>();
buildContext.findAncestorRenderObjectOfType<targetType>(); buildContext.findAncestorRenderObjectOfType<targetType>();
// Changes made in https://github.com/flutter/flutter/pull/61648
const Form form = Form(autovalidateMode: AutoValidateMode.always);
const Form form = Form(autovalidateMode: AutoValidateMode.disabled);
final autoMode = form.autovalidateMode;
// Changes made in https://github.com/flutter/flutter/pull/61648
const FormField formField = FormField(autovalidateMode: AutoValidateMode.always);
const FormField formField = FormField(autovalidateMode: AutoValidateMode.disabled);
final autoMode = formField.autovalidateMode;
} }
...@@ -27,6 +27,24 @@ void main() { ...@@ -27,6 +27,24 @@ void main() {
buildContext.rootAncestorStateOfType(TypeMatcher<targetType>()); buildContext.rootAncestorStateOfType(TypeMatcher<targetType>());
buildContext.ancestorRenderObjectOfType(TypeMatcher<targetType>()); buildContext.ancestorRenderObjectOfType(TypeMatcher<targetType>());
// Changes made in https://github.com/flutter/flutter/pull/61648
const Form form = Form(autovalidate: true);
const Form form = Form(autovalidate: false);
final autoMode = form.autovalidate;
// Changes made in https://github.com/flutter/flutter/pull/61648
const FormField formField = FormField(autovalidate: true);
const FormField formField = FormField(autovalidate: false);
final autoMode = formField.autovalidate;
// Changes made in https://github.com/flutter/flutter/pull/61648
const TextFormField textFormField = TextFormField(autovalidate: true);
const TextFormField textFormField = TextFormField(autovalidate: false);
// Changes made in https://github.com/flutter/flutter/pull/61648
const DropdownButtonFormField dropDownButtonFormField = DropdownButtonFormField(autovalidate: true);
const DropdownButtonFormField dropdownButtonFormField = DropdownButtonFormField(autovalidate: false);
// Changes made in https://github.com/flutter/flutter/pull/48547 // Changes made in https://github.com/flutter/flutter/pull/48547
var TextTheme textTheme = TextTheme( var TextTheme textTheme = TextTheme(
display4: displayStyle4, display4: displayStyle4,
......
...@@ -27,6 +27,24 @@ void main() { ...@@ -27,6 +27,24 @@ void main() {
buildContext.findRootAncestorStateOfType<targetType>(); buildContext.findRootAncestorStateOfType<targetType>();
buildContext.findAncestorRenderObjectOfType<targetType>(); buildContext.findAncestorRenderObjectOfType<targetType>();
// Changes made in https://github.com/flutter/flutter/pull/61648
const Form form = Form(autovalidateMode: AutoValidateMode.always);
const Form form = Form(autovalidateMode: AutoValidateMode.disabled);
final autoMode = form.autovalidateMode;
// Changes made in https://github.com/flutter/flutter/pull/61648
const FormField formField = FormField(autovalidateMode: AutoValidateMode.always);
const FormField formField = FormField(autovalidateMode: AutoValidateMode.disabled);
final autoMode = formField.autovalidateMode;
// Changes made in https://github.com/flutter/flutter/pull/61648
const TextFormField textFormField = TextFormField(autovalidateMode: AutoValidateMode.always);
const TextFormField textFormField = TextFormField(autovalidateMode: AutoValidateMode.disabled);
// Changes made in https://github.com/flutter/flutter/pull/61648
const DropdownButtonFormField dropDownButtonFormField = DropdownButtonFormField(autovalidateMode: AutoValidateMode.always);
const DropdownButtonFormField dropdownButtonFormField = DropdownButtonFormField(autovalidateMode: AutoValidateMode.disabled);
// Changes made in https://github.com/flutter/flutter/pull/48547 // Changes made in https://github.com/flutter/flutter/pull/48547
var TextTheme textTheme = TextTheme( var TextTheme textTheme = TextTheme(
headline1: displayStyle4, headline1: displayStyle4,
......
...@@ -24,6 +24,16 @@ void main() { ...@@ -24,6 +24,16 @@ void main() {
buildContext.rootAncestorStateOfType(TypeMatcher<targetType>()); buildContext.rootAncestorStateOfType(TypeMatcher<targetType>());
buildContext.ancestorRenderObjectOfType(TypeMatcher<targetType>()); buildContext.ancestorRenderObjectOfType(TypeMatcher<targetType>());
// Changes made in https://github.com/flutter/flutter/pull/61648
const Form form = Form(autovalidate: true);
const Form form = Form(autovalidate: false);
final autoMode = form.autovalidate;
// Changes made in https://github.com/flutter/flutter/pull/61648
const FormField formField = FormField(autovalidate: true);
const FormField formField = FormField(autovalidate: false);
final autoMode = formField.autovalidate;
// Changes made in https://github.com/flutter/flutter/pull/66305 // Changes made in https://github.com/flutter/flutter/pull/66305
const Stack stack = Stack(overflow: Overflow.visible); const Stack stack = Stack(overflow: Overflow.visible);
const Stack stack = Stack(overflow: Overflow.clip); const Stack stack = Stack(overflow: Overflow.clip);
......
...@@ -24,6 +24,16 @@ void main() { ...@@ -24,6 +24,16 @@ void main() {
buildContext.findRootAncestorStateOfType<targetType>(); buildContext.findRootAncestorStateOfType<targetType>();
buildContext.findAncestorRenderObjectOfType<targetType>(); buildContext.findAncestorRenderObjectOfType<targetType>();
// Changes made in https://github.com/flutter/flutter/pull/61648
const Form form = Form(autovalidateMode: AutoValidateMode.always);
const Form form = Form(autovalidateMode: AutoValidateMode.disabled);
final autoMode = form.autovalidateMode;
// Changes made in https://github.com/flutter/flutter/pull/61648
const FormField formField = FormField(autovalidateMode: AutoValidateMode.always);
const FormField formField = FormField(autovalidateMode: AutoValidateMode.disabled);
final autoMode = formField.autovalidateMode;
// Changes made in https://github.com/flutter/flutter/pull/66305 // Changes made in https://github.com/flutter/flutter/pull/66305
const Stack stack = Stack(clipBehavior: Clip.none); const Stack stack = Stack(clipBehavior: Clip.none);
const Stack stack = Stack(clipBehavior: Clip.hardEdge); const Stack stack = Stack(clipBehavior: Clip.hardEdge);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment