Add fixes for deprecations in TextTheme (#73994)
This commit is contained in:
parent
79d0358ece
commit
8aeef71e99
@ -11,6 +11,194 @@
|
|||||||
version: 1
|
version: 1
|
||||||
transforms:
|
transforms:
|
||||||
|
|
||||||
|
# Changes made in https://github.com/flutter/flutter/pull/48547
|
||||||
|
- title: 'Renamed to headline1'
|
||||||
|
date: 2020-01-24
|
||||||
|
element:
|
||||||
|
uris: [ 'material.dart' ]
|
||||||
|
getter: display4
|
||||||
|
inClass: 'TextTheme'
|
||||||
|
changes:
|
||||||
|
- kind: 'rename'
|
||||||
|
newName: 'headline1'
|
||||||
|
|
||||||
|
# Changes made in https://github.com/flutter/flutter/pull/48547
|
||||||
|
- title: 'Renamed to headline2'
|
||||||
|
date: 2020-01-24
|
||||||
|
element:
|
||||||
|
uris: [ 'material.dart' ]
|
||||||
|
getter: display3
|
||||||
|
inClass: 'TextTheme'
|
||||||
|
changes:
|
||||||
|
- kind: 'rename'
|
||||||
|
newName: 'headline2'
|
||||||
|
|
||||||
|
# Changes made in https://github.com/flutter/flutter/pull/48547
|
||||||
|
- title: 'Renamed to headline3'
|
||||||
|
date: 2020-01-24
|
||||||
|
element:
|
||||||
|
uris: [ 'material.dart' ]
|
||||||
|
getter: display2
|
||||||
|
inClass: 'TextTheme'
|
||||||
|
changes:
|
||||||
|
- kind: 'rename'
|
||||||
|
newName: 'headline3'
|
||||||
|
|
||||||
|
# Changes made in https://github.com/flutter/flutter/pull/48547
|
||||||
|
- title: 'Renamed to headline4'
|
||||||
|
date: 2020-01-24
|
||||||
|
element:
|
||||||
|
uris: [ 'material.dart' ]
|
||||||
|
getter: display1
|
||||||
|
inClass: 'TextTheme'
|
||||||
|
changes:
|
||||||
|
- kind: 'rename'
|
||||||
|
newName: 'headline4'
|
||||||
|
|
||||||
|
# Changes made in https://github.com/flutter/flutter/pull/48547
|
||||||
|
- title: 'Renamed to headline5'
|
||||||
|
date: 2020-01-24
|
||||||
|
element:
|
||||||
|
uris: [ 'material.dart' ]
|
||||||
|
getter: headline
|
||||||
|
inClass: 'TextTheme'
|
||||||
|
changes:
|
||||||
|
- kind: 'rename'
|
||||||
|
newName: 'headline5'
|
||||||
|
|
||||||
|
# Changes made in https://github.com/flutter/flutter/pull/48547
|
||||||
|
- title: 'Renamed to headline6'
|
||||||
|
date: 2020-01-24
|
||||||
|
element:
|
||||||
|
uris: [ 'material.dart' ]
|
||||||
|
getter: title
|
||||||
|
inClass: 'TextTheme'
|
||||||
|
changes:
|
||||||
|
- kind: 'rename'
|
||||||
|
newName: 'headline6'
|
||||||
|
|
||||||
|
# Changes made in https://github.com/flutter/flutter/pull/48547
|
||||||
|
- title: 'Renamed to subtitle1'
|
||||||
|
date: 2020-01-24
|
||||||
|
element:
|
||||||
|
uris: [ 'material.dart' ]
|
||||||
|
getter: subhead
|
||||||
|
inClass: 'TextTheme'
|
||||||
|
changes:
|
||||||
|
- kind: 'rename'
|
||||||
|
newName: 'subtitle1'
|
||||||
|
|
||||||
|
# Changes made in https://github.com/flutter/flutter/pull/48547
|
||||||
|
- title: 'Renamed to bodyText1'
|
||||||
|
date: 2020-01-24
|
||||||
|
element:
|
||||||
|
uris: [ 'material.dart' ]
|
||||||
|
getter: body2
|
||||||
|
inClass: 'TextTheme'
|
||||||
|
changes:
|
||||||
|
- kind: 'rename'
|
||||||
|
newName: 'bodyText1'
|
||||||
|
|
||||||
|
# Changes made in https://github.com/flutter/flutter/pull/48547
|
||||||
|
- title: 'Renamed to bodyText2'
|
||||||
|
date: 2020-01-24
|
||||||
|
element:
|
||||||
|
uris: [ 'material.dart' ]
|
||||||
|
getter: body1
|
||||||
|
inClass: 'TextTheme'
|
||||||
|
changes:
|
||||||
|
- kind: 'rename'
|
||||||
|
newName: 'bodyText2'
|
||||||
|
|
||||||
|
# Changes made in https://github.com/flutter/flutter/pull/48547
|
||||||
|
- title: 'Renamed to subtitle2'
|
||||||
|
date: 2020-01-24
|
||||||
|
element:
|
||||||
|
uris: [ 'material.dart' ]
|
||||||
|
getter: subtitle
|
||||||
|
inClass: 'TextTheme'
|
||||||
|
changes:
|
||||||
|
- kind: 'rename'
|
||||||
|
newName: 'subtitle2'
|
||||||
|
|
||||||
|
# Changes made in https://github.com/flutter/flutter/pull/48547
|
||||||
|
- title: 'Rename arguments'
|
||||||
|
date: 2020-01-24
|
||||||
|
element:
|
||||||
|
uris: [ 'material.dart' ]
|
||||||
|
constructor: ''
|
||||||
|
inClass: 'TextTheme'
|
||||||
|
changes:
|
||||||
|
- kind: 'renameParameter'
|
||||||
|
oldName: 'display4'
|
||||||
|
newName: 'headline1'
|
||||||
|
- kind: 'renameParameter'
|
||||||
|
oldName: 'display3'
|
||||||
|
newName: 'headline2'
|
||||||
|
- kind: 'renameParameter'
|
||||||
|
oldName: 'display2'
|
||||||
|
newName: 'headline3'
|
||||||
|
- kind: 'renameParameter'
|
||||||
|
oldName: 'display1'
|
||||||
|
newName: 'headline4'
|
||||||
|
- kind: 'renameParameter'
|
||||||
|
oldName: 'headline'
|
||||||
|
newName: 'headline5'
|
||||||
|
- kind: 'renameParameter'
|
||||||
|
oldName: 'title'
|
||||||
|
newName: 'headline6'
|
||||||
|
- kind: 'renameParameter'
|
||||||
|
oldName: 'subhead'
|
||||||
|
newName: 'subtitle1'
|
||||||
|
- kind: 'renameParameter'
|
||||||
|
oldName: 'subtitle'
|
||||||
|
newName: 'subtitle2'
|
||||||
|
- kind: 'renameParameter'
|
||||||
|
oldName: 'body2'
|
||||||
|
newName: 'bodyText1'
|
||||||
|
- kind: 'renameParameter'
|
||||||
|
oldName: 'body1'
|
||||||
|
newName: 'bodyText2'
|
||||||
|
|
||||||
|
# Changes made in https://github.com/flutter/flutter/pull/48547
|
||||||
|
- title: 'Rename arguments'
|
||||||
|
date: 2020-01-24
|
||||||
|
element:
|
||||||
|
uris: [ 'material.dart' ]
|
||||||
|
method: 'copyWith'
|
||||||
|
inClass: 'TextTheme'
|
||||||
|
changes:
|
||||||
|
- kind: 'renameParameter'
|
||||||
|
oldName: 'display4'
|
||||||
|
newName: 'headline1'
|
||||||
|
- kind: 'renameParameter'
|
||||||
|
oldName: 'display3'
|
||||||
|
newName: 'headline2'
|
||||||
|
- kind: 'renameParameter'
|
||||||
|
oldName: 'display2'
|
||||||
|
newName: 'headline3'
|
||||||
|
- kind: 'renameParameter'
|
||||||
|
oldName: 'display1'
|
||||||
|
newName: 'headline4'
|
||||||
|
- kind: 'renameParameter'
|
||||||
|
oldName: 'headline'
|
||||||
|
newName: 'headline5'
|
||||||
|
- kind: 'renameParameter'
|
||||||
|
oldName: 'title'
|
||||||
|
newName: 'headline6'
|
||||||
|
- kind: 'renameParameter'
|
||||||
|
oldName: 'subhead'
|
||||||
|
newName: 'subtitle1'
|
||||||
|
- kind: 'renameParameter'
|
||||||
|
oldName: 'subtitle'
|
||||||
|
newName: 'subtitle2'
|
||||||
|
- kind: 'renameParameter'
|
||||||
|
oldName: 'body2'
|
||||||
|
newName: 'bodyText1'
|
||||||
|
- kind: 'renameParameter'
|
||||||
|
oldName: 'body1'
|
||||||
|
newName: 'bodyText2'
|
||||||
|
|
||||||
# Changes made in https://github.com/flutter/flutter/pull/66305
|
# Changes made in https://github.com/flutter/flutter/pull/66305
|
||||||
- title: 'Migrate to clipBehavior'
|
- title: 'Migrate to clipBehavior'
|
||||||
date: 2020-09-22
|
date: 2020-09-22
|
||||||
|
@ -26,4 +26,54 @@ 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/48547
|
||||||
|
var TextTheme textTheme = TextTheme(
|
||||||
|
display4: displayStyle4,
|
||||||
|
display3: displayStyle3,
|
||||||
|
display2: displayStyle2,
|
||||||
|
display1: displayStyle1,
|
||||||
|
headline: headlineStyle,
|
||||||
|
title: titleStyle,
|
||||||
|
subhead: subheadStyle,
|
||||||
|
body2: body2Style,
|
||||||
|
body1: body1Style,
|
||||||
|
caption: captionStyle,
|
||||||
|
button: buttonStyle,
|
||||||
|
subtitle: subtitleStyle,
|
||||||
|
overline: overlineStyle,
|
||||||
|
);
|
||||||
|
|
||||||
|
// Changes made in https://github.com/flutter/flutter/pull/48547
|
||||||
|
var TextTheme copiedTextTheme = TextTheme.copyWith(
|
||||||
|
display4: displayStyle4,
|
||||||
|
display3: displayStyle3,
|
||||||
|
display2: displayStyle2,
|
||||||
|
display1: displayStyle1,
|
||||||
|
headline: headlineStyle,
|
||||||
|
title: titleStyle,
|
||||||
|
subhead: subheadStyle,
|
||||||
|
body2: body2Style,
|
||||||
|
body1: body1Style,
|
||||||
|
caption: captionStyle,
|
||||||
|
button: buttonStyle,
|
||||||
|
subtitle: subtitleStyle,
|
||||||
|
overline: overlineStyle,
|
||||||
|
);
|
||||||
|
|
||||||
|
// Changes made in https://github.com/flutter/flutter/pull/48547
|
||||||
|
var style;
|
||||||
|
style = textTheme.display4;
|
||||||
|
style = textTheme.display3;
|
||||||
|
style = textTheme.display2;
|
||||||
|
style = textTheme.display1;
|
||||||
|
style = textTheme.headline;
|
||||||
|
style = textTheme.title;
|
||||||
|
style = textTheme.subhead;
|
||||||
|
style = textTheme.body2;
|
||||||
|
style = textTheme.body1;
|
||||||
|
style = textTheme.caption;
|
||||||
|
style = textTheme.button;
|
||||||
|
style = textTheme.subtitle;
|
||||||
|
style = textTheme.overline;
|
||||||
}
|
}
|
||||||
|
@ -26,4 +26,54 @@ 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/48547
|
||||||
|
var TextTheme textTheme = TextTheme(
|
||||||
|
headline1: displayStyle4,
|
||||||
|
headline2: displayStyle3,
|
||||||
|
headline3: displayStyle2,
|
||||||
|
headline4: displayStyle1,
|
||||||
|
headline5: headlineStyle,
|
||||||
|
headline6: titleStyle,
|
||||||
|
subtitle1: subheadStyle,
|
||||||
|
bodyText1: body2Style,
|
||||||
|
bodyText2: body1Style,
|
||||||
|
caption: captionStyle,
|
||||||
|
button: buttonStyle,
|
||||||
|
subtitle2: subtitleStyle,
|
||||||
|
overline: overlineStyle,
|
||||||
|
);
|
||||||
|
|
||||||
|
// Changes made in https://github.com/flutter/flutter/pull/48547
|
||||||
|
var TextTheme copiedTextTheme = TextTheme.copyWith(
|
||||||
|
headline1: displayStyle4,
|
||||||
|
headline2: displayStyle3,
|
||||||
|
headline3: displayStyle2,
|
||||||
|
headline4: displayStyle1,
|
||||||
|
headline5: headlineStyle,
|
||||||
|
headline6: titleStyle,
|
||||||
|
subtitle1: subheadStyle,
|
||||||
|
bodyText1: body2Style,
|
||||||
|
bodyText2: body1Style,
|
||||||
|
caption: captionStyle,
|
||||||
|
button: buttonStyle,
|
||||||
|
subtitle2: subtitleStyle,
|
||||||
|
overline: overlineStyle,
|
||||||
|
);
|
||||||
|
|
||||||
|
// Changes made in https://github.com/flutter/flutter/pull/48547
|
||||||
|
var style;
|
||||||
|
style = textTheme.headline1;
|
||||||
|
style = textTheme.headline2;
|
||||||
|
style = textTheme.headline3;
|
||||||
|
style = textTheme.headline4;
|
||||||
|
style = textTheme.headline5;
|
||||||
|
style = textTheme.headline6;
|
||||||
|
style = textTheme.subtitle1;
|
||||||
|
style = textTheme.bodyText1;
|
||||||
|
style = textTheme.bodyText2;
|
||||||
|
style = textTheme.caption;
|
||||||
|
style = textTheme.button;
|
||||||
|
style = textTheme.subtitle2;
|
||||||
|
style = textTheme.overline;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user