Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
f5b65bad
Unverified
Commit
f5b65bad
authored
Mar 28, 2024
by
Renzo Olivares
Committed by
GitHub
Mar 28, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove deprecated `TextTheme` members (#139255)
Part of:
https://github.com/flutter/flutter/issues/143956
parent
2079f349
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
81 additions
and
337 deletions
+81
-337
value_listenable_builder.0.dart
.../value_listenable_builder/value_listenable_builder.0.dart
+1
-1
button_theme.dart
packages/flutter/lib/src/material/button_theme.dart
+1
-1
popup_menu.dart
packages/flutter/lib/src/material/popup_menu.dart
+1
-1
text_theme.dart
packages/flutter/lib/src/material/text_theme.dart
+46
-302
banner_theme_test.dart
packages/flutter/test/material/banner_theme_test.dart
+4
-4
popup_menu_test.dart
packages/flutter/test/material/popup_menu_test.dart
+3
-3
stepper_test.dart
packages/flutter/test/material/stepper_test.dart
+3
-3
typography_test.dart
packages/flutter/test/material/typography_test.dart
+13
-13
editable_text_test.dart
packages/flutter/test/widgets/editable_text_test.dart
+9
-9
No files found.
examples/api/lib/widgets/value_listenable_builder/value_listenable_builder.0.dart
View file @
f5b65bad
...
...
@@ -88,7 +88,7 @@ class CountDisplay extends StatelessWidget {
width:
100
,
height:
100
,
padding:
const
EdgeInsetsDirectional
.
all
(
10
),
child:
Text
(
'
$count
'
,
style:
Theme
.
of
(
context
).
textTheme
.
headline
4
),
child:
Text
(
'
$count
'
,
style:
Theme
.
of
(
context
).
textTheme
.
headline
Medium
),
);
}
}
packages/flutter/lib/src/material/button_theme.dart
View file @
f5b65bad
...
...
@@ -381,7 +381,7 @@ class ButtonThemeData with Diagnosticable {
/// minimum size, internal padding, and shape.
///
/// Despite the name, this property is not the [TextTheme] whose
/// [TextTheme.
button
] is used as the button text's [TextStyle].
/// [TextTheme.
labelLarge
] is used as the button text's [TextStyle].
ButtonTextTheme
getTextTheme
(
MaterialButton
button
)
=>
button
.
textTheme
??
textTheme
;
/// The foreground color of the [button]'s text and icon when
...
...
packages/flutter/lib/src/material/popup_menu.dart
View file @
f5b65bad
...
...
@@ -1507,7 +1507,7 @@ class _PopupMenuDefaultsM2 extends PopupMenuThemeData {
late
final
TextTheme
_textTheme
=
_theme
.
textTheme
;
@override
TextStyle
?
get
textStyle
=>
_textTheme
.
subtitle1
;
TextStyle
?
get
textStyle
=>
_textTheme
.
titleMedium
;
static
EdgeInsets
menuHorizontalPadding
=
const
EdgeInsets
.
symmetric
(
horizontal:
16.0
);
}
...
...
packages/flutter/lib/src/material/text_theme.dart
View file @
f5b65bad
...
...
@@ -27,27 +27,28 @@ import 'typography.dart';
///
/// The names of the 2018 TextTheme properties match this table from the
/// [Material Design spec](https://material.io/design/typography/the-type-system.html#type-scale)
/// with two exceptions: the styles called H1-H6 in the spec are
/// headline1-headline6 in the API, and body1,body2 are called
/// bodyText1 and bodyText2.
/// with a few exceptions: the styles called H1-H6 in the spec are
/// displayLarge-titleLarge in the API chart, body1,body2 are called
/// bodyLarge and bodyMedium, caption is now bodySmall, button is labelLarge,
/// and overline is now labelSmall.
///
/// The 2018 spec has thirteen text styles:
///
/// | NAME | SIZE | WEIGHT | SPACING | |
/// |------------|------|---------|----------|-------------|
/// |
headline1
| 96.0 | light | -1.5 | |
/// |
headline2
| 60.0 | light | -0.5 | |
/// |
headline3
| 48.0 | regular | 0.0 | |
/// | headline
4
| 34.0 | regular | 0.25 | |
/// | headline
5
| 24.0 | regular | 0.0 | |
/// |
headline6
| 20.0 | medium | 0.15 | |
/// |
subtitle1
| 16.0 | regular | 0.15 | |
/// |
subtitle2
| 14.0 | medium | 0.1 | |
/// | body
1 | 16.0 | regular | 0.5 | (bodyText1)
|
/// | body
2 | 14.0 | regular | 0.25 | (bodyText2)
|
/// | b
utton | 14.0 | medium | 1.25
| |
/// |
caption | 12.0 | regular | 0.4
| |
/// |
overline
| 10.0 | regular | 1.5 | |
/// | NAME
| SIZE | WEIGHT | SPACING | |
/// |------------
----
|------|---------|----------|-------------|
/// |
displayLarge
| 96.0 | light | -1.5 | |
/// |
displayMedium
| 60.0 | light | -0.5 | |
/// |
displaySmall
| 48.0 | regular | 0.0 | |
/// | headline
Medium
| 34.0 | regular | 0.25 | |
/// | headline
Small
| 24.0 | regular | 0.0 | |
/// |
titleLarge
| 20.0 | medium | 0.15 | |
/// |
titleMedium
| 16.0 | regular | 0.15 | |
/// |
titleSmall
| 14.0 | medium | 0.1 | |
/// | body
Large | 16.0 | regular | 0.5 |
|
/// | body
Medium | 14.0 | regular | 0.25 |
|
/// | b
odySmall | 12.0 | regular | 0.4
| |
/// |
labelLarge | 14.0 | medium | 1.25
| |
/// |
labelSmall
| 10.0 | regular | 1.5 | |
///
/// ...where "light" is `FontWeight.w300`, "regular" is `FontWeight.w400` and
/// "medium" is `FontWeight.w500`.
...
...
@@ -86,108 +87,22 @@ class TextTheme with Diagnosticable {
/// other is allowed in this constructor. The 2018 styles are deprecated and
/// will eventually be removed.
const
TextTheme
({
TextStyle
?
displayLarge
,
TextStyle
?
displayMedium
,
TextStyle
?
displaySmall
,
this
.
displayLarge
,
this
.
displayMedium
,
this
.
displaySmall
,
this
.
headlineLarge
,
TextStyle
?
headlineMedium
,
TextStyle
?
headlineSmall
,
TextStyle
?
titleLarge
,
TextStyle
?
titleMedium
,
TextStyle
?
titleSmall
,
TextStyle
?
bodyLarge
,
TextStyle
?
bodyMedium
,
TextStyle
?
bodySmall
,
TextStyle
?
labelLarge
,
this
.
headlineMedium
,
this
.
headlineSmall
,
this
.
titleLarge
,
this
.
titleMedium
,
this
.
titleSmall
,
this
.
bodyLarge
,
this
.
bodyMedium
,
this
.
bodySmall
,
this
.
labelLarge
,
this
.
labelMedium
,
TextStyle
?
labelSmall
,
@Deprecated
(
'Use displayLarge instead. '
'This feature was deprecated after v3.1.0-0.0.pre.'
,
)
TextStyle
?
headline1
,
@Deprecated
(
'Use displayMedium instead. '
'This feature was deprecated after v3.1.0-0.0.pre.'
,
)
TextStyle
?
headline2
,
@Deprecated
(
'Use displaySmall instead. '
'This feature was deprecated after v3.1.0-0.0.pre.'
,
)
TextStyle
?
headline3
,
@Deprecated
(
'Use headlineMedium instead. '
'This feature was deprecated after v3.1.0-0.0.pre.'
,
)
TextStyle
?
headline4
,
@Deprecated
(
'Use headlineSmall instead. '
'This feature was deprecated after v3.1.0-0.0.pre.'
,
)
TextStyle
?
headline5
,
@Deprecated
(
'Use titleLarge instead. '
'This feature was deprecated after v3.1.0-0.0.pre.'
,
)
TextStyle
?
headline6
,
@Deprecated
(
'Use titleMedium instead. '
'This feature was deprecated after v3.1.0-0.0.pre.'
,
)
TextStyle
?
subtitle1
,
@Deprecated
(
'Use titleSmall instead. '
'This feature was deprecated after v3.1.0-0.0.pre.'
,
)
TextStyle
?
subtitle2
,
@Deprecated
(
'Use bodyLarge instead. '
'This feature was deprecated after v3.1.0-0.0.pre.'
,
)
TextStyle
?
bodyText1
,
@Deprecated
(
'Use bodyMedium instead. '
'This feature was deprecated after v3.1.0-0.0.pre.'
,
)
TextStyle
?
bodyText2
,
@Deprecated
(
'Use bodySmall instead. '
'This feature was deprecated after v3.1.0-0.0.pre.'
,
)
TextStyle
?
caption
,
@Deprecated
(
'Use labelLarge instead. '
'This feature was deprecated after v3.1.0-0.0.pre.'
,
)
TextStyle
?
button
,
@Deprecated
(
'Use labelSmall instead. '
'This feature was deprecated after v3.1.0-0.0.pre.'
,
)
TextStyle
?
overline
,
})
:
assert
(
(
displayLarge
==
null
&&
displayMedium
==
null
&&
displaySmall
==
null
&&
headlineMedium
==
null
&&
headlineSmall
==
null
&&
titleLarge
==
null
&&
titleMedium
==
null
&&
titleSmall
==
null
&&
bodyLarge
==
null
&&
bodyMedium
==
null
&&
bodySmall
==
null
&&
labelLarge
==
null
&&
labelSmall
==
null
)
||
(
headline1
==
null
&&
headline2
==
null
&&
headline3
==
null
&&
headline4
==
null
&&
headline5
==
null
&&
headline6
==
null
&&
subtitle1
==
null
&&
subtitle2
==
null
&&
bodyText1
==
null
&&
bodyText2
==
null
&&
caption
==
null
&&
button
==
null
&&
overline
==
null
),
'Cannot mix 2018 and 2021 terms in call to TextTheme() constructor.'
),
displayLarge
=
displayLarge
??
headline1
,
displayMedium
=
displayMedium
??
headline2
,
displaySmall
=
displaySmall
??
headline3
,
headlineMedium
=
headlineMedium
??
headline4
,
headlineSmall
=
headlineSmall
??
headline5
,
titleLarge
=
titleLarge
??
headline6
,
titleMedium
=
titleMedium
??
subtitle1
,
titleSmall
=
titleSmall
??
subtitle2
,
bodyLarge
=
bodyLarge
??
bodyText1
,
bodyMedium
=
bodyMedium
??
bodyText2
,
bodySmall
=
bodySmall
??
caption
,
labelLarge
=
labelLarge
??
button
,
labelSmall
=
labelSmall
??
overline
;
this
.
labelSmall
,
});
/// Largest of the display styles.
///
...
...
@@ -283,103 +198,6 @@ class TextTheme with Diagnosticable {
/// content body, like captions.
final
TextStyle
?
labelSmall
;
/// Extremely large text.
@Deprecated
(
'Use displayLarge instead. '
'This feature was deprecated after v3.1.0-0.0.pre.'
,
)
TextStyle
?
get
headline1
=>
displayLarge
;
/// Very, very large text.
///
/// Used for the date in the dialog shown by [showDatePicker].
@Deprecated
(
'Use displayMedium instead. '
'This feature was deprecated after v3.1.0-0.0.pre.'
,
)
TextStyle
?
get
headline2
=>
displayMedium
;
/// Very large text.
@Deprecated
(
'Use displaySmall instead. '
'This feature was deprecated after v3.1.0-0.0.pre.'
,
)
TextStyle
?
get
headline3
=>
displaySmall
;
/// Large text.
@Deprecated
(
'Use headlineMedium instead. '
'This feature was deprecated after v3.1.0-0.0.pre.'
,
)
TextStyle
?
get
headline4
=>
headlineMedium
;
/// Used for large text in dialogs (e.g., the month and year in the dialog
/// shown by [showDatePicker]).
@Deprecated
(
'Use headlineSmall instead. '
'This feature was deprecated after v3.1.0-0.0.pre.'
,
)
TextStyle
?
get
headline5
=>
headlineSmall
;
/// Used for the primary text in app bars and dialogs (e.g., [AppBar.title]
/// and [AlertDialog.title]).
@Deprecated
(
'Use titleLarge instead. '
'This feature was deprecated after v3.1.0-0.0.pre.'
,
)
TextStyle
?
get
headline6
=>
titleLarge
;
/// Used for the primary text in lists (e.g., [ListTile.title]).
@Deprecated
(
'Use titleMedium instead. '
'This feature was deprecated after v3.1.0-0.0.pre.'
,
)
TextStyle
?
get
subtitle1
=>
titleMedium
;
/// For medium emphasis text that's a little smaller than [titleMedium].
@Deprecated
(
'Use titleSmall instead. '
'This feature was deprecated after v3.1.0-0.0.pre.'
,
)
TextStyle
?
get
subtitle2
=>
titleSmall
;
/// Used for emphasizing text that would otherwise be [bodyMedium].
@Deprecated
(
'Use bodyLarge instead. '
'This feature was deprecated after v3.1.0-0.0.pre.'
,
)
TextStyle
?
get
bodyText1
=>
bodyLarge
;
/// The default text style for [Material].
@Deprecated
(
'Use bodyMedium instead. '
'This feature was deprecated after v3.1.0-0.0.pre.'
,
)
TextStyle
?
get
bodyText2
=>
bodyMedium
;
/// Used for auxiliary text associated with images.
@Deprecated
(
'Use bodySmall instead. '
'This feature was deprecated after v3.1.0-0.0.pre.'
,
)
TextStyle
?
get
caption
=>
bodySmall
;
/// Used for text on [ElevatedButton], [TextButton] and [OutlinedButton].
@Deprecated
(
'Use labelLarge instead. '
'This feature was deprecated after v3.1.0-0.0.pre.'
,
)
TextStyle
?
get
button
=>
labelLarge
;
/// The smallest style.
///
/// Typically used for captions or to introduce a (larger) headline.
@Deprecated
(
'Use labelSmall instead. '
'This feature was deprecated after v3.1.0-0.0.pre.'
,
)
TextStyle
?
get
overline
=>
labelSmall
;
/// Creates a copy of this text theme but with the given fields replaced with
/// the new values.
///
...
...
@@ -436,97 +254,23 @@ class TextTheme with Diagnosticable {
TextStyle
?
labelLarge
,
TextStyle
?
labelMedium
,
TextStyle
?
labelSmall
,
@Deprecated
(
'Use displayLarge instead. '
'This feature was deprecated after v3.1.0-0.0.pre.'
,
)
TextStyle
?
headline1
,
@Deprecated
(
'Use displayMedium instead. '
'This feature was deprecated after v3.1.0-0.0.pre.'
,
)
TextStyle
?
headline2
,
@Deprecated
(
'Use displaySmall instead. '
'This feature was deprecated after v3.1.0-0.0.pre.'
,
)
TextStyle
?
headline3
,
@Deprecated
(
'Use headlineMedium instead. '
'This feature was deprecated after v3.1.0-0.0.pre.'
,
)
TextStyle
?
headline4
,
@Deprecated
(
'Use headlineSmall instead. '
'This feature was deprecated after v3.1.0-0.0.pre.'
,
)
TextStyle
?
headline5
,
@Deprecated
(
'Use titleLarge instead. '
'This feature was deprecated after v3.1.0-0.0.pre.'
,
)
TextStyle
?
headline6
,
@Deprecated
(
'Use titleMedium instead. '
'This feature was deprecated after v3.1.0-0.0.pre.'
,
)
TextStyle
?
subtitle1
,
@Deprecated
(
'Use titleSmall instead. '
'This feature was deprecated after v3.1.0-0.0.pre.'
,
)
TextStyle
?
subtitle2
,
@Deprecated
(
'Use bodyLarge instead. '
'This feature was deprecated after v3.1.0-0.0.pre.'
,
)
TextStyle
?
bodyText1
,
@Deprecated
(
'Use bodyMedium instead. '
'This feature was deprecated after v3.1.0-0.0.pre.'
,
)
TextStyle
?
bodyText2
,
@Deprecated
(
'Use bodySmall instead. '
'This feature was deprecated after v3.1.0-0.0.pre.'
,
)
TextStyle
?
caption
,
@Deprecated
(
'Use labelLarge instead. '
'This feature was deprecated after v3.1.0-0.0.pre.'
,
)
TextStyle
?
button
,
@Deprecated
(
'Use labelSmall instead. '
'This feature was deprecated after v3.1.0-0.0.pre.'
,
)
TextStyle
?
overline
,
})
{
assert
(
(
displayLarge
==
null
&&
displayMedium
==
null
&&
displaySmall
==
null
&&
headlineMedium
==
null
&&
headlineSmall
==
null
&&
titleLarge
==
null
&&
titleMedium
==
null
&&
titleSmall
==
null
&&
bodyLarge
==
null
&&
bodyMedium
==
null
&&
bodySmall
==
null
&&
labelLarge
==
null
&&
labelSmall
==
null
)
||
(
headline1
==
null
&&
headline2
==
null
&&
headline3
==
null
&&
headline4
==
null
&&
headline5
==
null
&&
headline6
==
null
&&
subtitle1
==
null
&&
subtitle2
==
null
&&
bodyText1
==
null
&&
bodyText2
==
null
&&
caption
==
null
&&
button
==
null
&&
overline
==
null
),
'Cannot mix 2018 and 2021 terms in call to TextTheme() constructor.'
);
return
TextTheme
(
displayLarge:
displayLarge
??
headline1
??
this
.
displayLarge
,
displayMedium:
displayMedium
??
headline2
??
this
.
displayMedium
,
displaySmall:
displaySmall
??
headline3
??
this
.
displaySmall
,
displayLarge:
displayLarge
??
this
.
displayLarge
,
displayMedium:
displayMedium
??
this
.
displayMedium
,
displaySmall:
displaySmall
??
this
.
displaySmall
,
headlineLarge:
headlineLarge
??
this
.
headlineLarge
,
headlineMedium:
headlineMedium
??
headline4
??
this
.
headlineMedium
,
headlineSmall:
headlineSmall
??
headline5
??
this
.
headlineSmall
,
titleLarge:
titleLarge
??
headline6
??
this
.
titleLarge
,
titleMedium:
titleMedium
??
subtitle1
??
this
.
titleMedium
,
titleSmall:
titleSmall
??
subtitle2
??
this
.
titleSmall
,
bodyLarge:
bodyLarge
??
bodyText1
??
this
.
bodyLarge
,
bodyMedium:
bodyMedium
??
bodyText2
??
this
.
bodyMedium
,
bodySmall:
bodySmall
??
caption
??
this
.
bodySmall
,
labelLarge:
labelLarge
??
button
??
this
.
labelLarge
,
headlineMedium:
headlineMedium
??
this
.
headlineMedium
,
headlineSmall:
headlineSmall
??
this
.
headlineSmall
,
titleLarge:
titleLarge
??
this
.
titleLarge
,
titleMedium:
titleMedium
??
this
.
titleMedium
,
titleSmall:
titleSmall
??
this
.
titleSmall
,
bodyLarge:
bodyLarge
??
this
.
bodyLarge
,
bodyMedium:
bodyMedium
??
this
.
bodyMedium
,
bodySmall:
bodySmall
??
this
.
bodySmall
,
labelLarge:
labelLarge
??
this
.
labelLarge
,
labelMedium:
labelMedium
??
this
.
labelMedium
,
labelSmall:
labelSmall
??
overline
??
this
.
labelSmall
,
labelSmall:
labelSmall
??
this
.
labelSmall
,
);
}
...
...
packages/flutter/test/material/banner_theme_test.dart
View file @
f5b65bad
...
...
@@ -482,8 +482,8 @@ void main() {
// Default value for ThemeData.typography is Typography.material2014()
expect
(
content
.
text
.
style
,
Typography
.
material2014
().
englishLike
.
body
Text2
!.
merge
(
Typography
.
material2014
().
black
.
body
Text2
,
Typography
.
material2014
().
englishLike
.
body
Medium
!.
merge
(
Typography
.
material2014
().
black
.
body
Medium
,
),
);
...
...
@@ -545,8 +545,8 @@ void main() {
// Default value for ThemeData.typography is Typography.material2014()
expect
(
content
.
text
.
style
,
Typography
.
material2014
().
englishLike
.
body
Text2
!.
merge
(
Typography
.
material2014
().
black
.
body
Text2
,
Typography
.
material2014
().
englishLike
.
body
Medium
!.
merge
(
Typography
.
material2014
().
black
.
body
Medium
,
),
);
...
...
packages/flutter/test/material/popup_menu_test.dart
View file @
f5b65bad
...
...
@@ -3737,11 +3737,11 @@ void main() {
// Test popup menu item with a Text widget.
expect
(
_labelStyle
(
tester
,
'Item 0'
)!.
fontSize
,
16.0
);
expect
(
_labelStyle
(
tester
,
'Item 0'
)!.
color
,
theme
.
textTheme
.
subtitle1
!.
color
);
expect
(
_labelStyle
(
tester
,
'Item 0'
)!.
color
,
theme
.
textTheme
.
titleMedium
!.
color
);
// Test popup menu item with a ListTile widget.
expect
(
_labelStyle
(
tester
,
'Item 1'
)!.
fontSize
,
16.0
);
expect
(
_labelStyle
(
tester
,
'Item 1'
)!.
color
,
theme
.
textTheme
.
subtitle1
!.
color
);
expect
(
_labelStyle
(
tester
,
'Item 1'
)!.
color
,
theme
.
textTheme
.
titleMedium
!.
color
);
// Close the menu.
await
tester
.
tapAt
(
const
Offset
(
20.0
,
20.0
));
...
...
@@ -3754,7 +3754,7 @@ void main() {
fontStyle:
FontStyle
.
italic
,
);
theme
=
theme
.
copyWith
(
textTheme:
const
TextTheme
(
subtitle1
:
customTextStyle
),
textTheme:
const
TextTheme
(
titleMedium
:
customTextStyle
),
);
await
tester
.
pumpWidget
(
buildMenu
());
...
...
packages/flutter/test/material/stepper_test.dart
View file @
f5b65bad
...
...
@@ -1404,9 +1404,9 @@ testWidgets('Stepper custom indexed controls test', (WidgetTester tester) async
home:
Material
(
child:
StatefulBuilder
(
builder:
(
BuildContext
context
,
StateSetter
setState
)
{
bodyLargeStyle
=
Theme
.
of
(
context
).
textTheme
.
body
Text1
!;
bodyMediumStyle
=
Theme
.
of
(
context
).
textTheme
.
body
Text2
!;
bodySmallStyle
=
Theme
.
of
(
context
).
textTheme
.
caption
!;
bodyLargeStyle
=
Theme
.
of
(
context
).
textTheme
.
body
Large
!;
bodyMediumStyle
=
Theme
.
of
(
context
).
textTheme
.
body
Medium
!;
bodySmallStyle
=
Theme
.
of
(
context
).
textTheme
.
bodySmall
!;
return
Stepper
(
type:
StepperType
.
horizontal
,
currentStep:
index
,
...
...
packages/flutter/test/material/typography_test.dart
View file @
f5b65bad
...
...
@@ -135,19 +135,19 @@ void main() {
const
FontWeight
regular
=
FontWeight
.
w400
;
const
FontWeight
medium
=
FontWeight
.
w500
;
//
H1
Roboto light 96 -1.5
//
Display Large
Roboto light 96 -1.5
expect
(
theme
.
displayLarge
!.
fontFamily
,
'Roboto'
);
expect
(
theme
.
displayLarge
!.
fontWeight
,
light
);
expect
(
theme
.
displayLarge
!.
fontSize
,
96
);
expect
(
theme
.
displayLarge
!.
letterSpacing
,
-
1.5
);
//
H2
Roboto light 60 -0.5
//
Display Medium
Roboto light 60 -0.5
expect
(
theme
.
displayMedium
!.
fontFamily
,
'Roboto'
);
expect
(
theme
.
displayMedium
!.
fontWeight
,
light
);
expect
(
theme
.
displayMedium
!.
fontSize
,
60
);
expect
(
theme
.
displayMedium
!.
letterSpacing
,
-
0.5
);
//
H3
Roboto regular 48 0
//
Display Small
Roboto regular 48 0
expect
(
theme
.
displaySmall
!.
fontFamily
,
'Roboto'
);
expect
(
theme
.
displaySmall
!.
fontWeight
,
regular
);
expect
(
theme
.
displaySmall
!.
fontSize
,
48
);
...
...
@@ -159,55 +159,55 @@ void main() {
expect
(
theme
.
headlineLarge
!.
fontSize
,
40
);
expect
(
theme
.
headlineLarge
!.
letterSpacing
,
0.25
);
// H
4
Roboto regular 34 0.25
// H
eadline Medium
Roboto regular 34 0.25
expect
(
theme
.
headlineMedium
!.
fontFamily
,
'Roboto'
);
expect
(
theme
.
headlineMedium
!.
fontWeight
,
regular
);
expect
(
theme
.
headlineMedium
!.
fontSize
,
34
);
expect
(
theme
.
headlineMedium
!.
letterSpacing
,
0.25
);
// H
5
Roboto regular 24 0
// H
eadline Small
Roboto regular 24 0
expect
(
theme
.
headlineSmall
!.
fontFamily
,
'Roboto'
);
expect
(
theme
.
headlineSmall
!.
fontWeight
,
regular
);
expect
(
theme
.
headlineSmall
!.
fontSize
,
24
);
expect
(
theme
.
headlineSmall
!.
letterSpacing
,
0
);
//
H6
Roboto medium 20 0.15
//
Title Large
Roboto medium 20 0.15
expect
(
theme
.
titleLarge
!.
fontFamily
,
'Roboto'
);
expect
(
theme
.
titleLarge
!.
fontWeight
,
medium
);
expect
(
theme
.
titleLarge
!.
fontSize
,
20
);
expect
(
theme
.
titleLarge
!.
letterSpacing
,
0.15
);
//
Subtitle1
Roboto regular 16 0.15
//
Title Medium
Roboto regular 16 0.15
expect
(
theme
.
titleMedium
!.
fontFamily
,
'Roboto'
);
expect
(
theme
.
titleMedium
!.
fontWeight
,
regular
);
expect
(
theme
.
titleMedium
!.
fontSize
,
16
);
expect
(
theme
.
titleMedium
!.
letterSpacing
,
0.15
);
//
Subtitle2
Roboto medium 14 0.1
//
Title Small
Roboto medium 14 0.1
expect
(
theme
.
titleSmall
!.
fontFamily
,
'Roboto'
);
expect
(
theme
.
titleSmall
!.
fontWeight
,
medium
);
expect
(
theme
.
titleSmall
!.
fontSize
,
14
);
expect
(
theme
.
titleSmall
!.
letterSpacing
,
0.1
);
// Body
1
Roboto regular 16 0.5
// Body
Large
Roboto regular 16 0.5
expect
(
theme
.
bodyLarge
!.
fontFamily
,
'Roboto'
);
expect
(
theme
.
bodyLarge
!.
fontWeight
,
regular
);
expect
(
theme
.
bodyLarge
!.
fontSize
,
16
);
expect
(
theme
.
bodyLarge
!.
letterSpacing
,
0.5
);
// Body
2
Roboto regular 14 0.25
// Body
Medium
Roboto regular 14 0.25
expect
(
theme
.
bodyMedium
!.
fontFamily
,
'Roboto'
);
expect
(
theme
.
bodyMedium
!.
fontWeight
,
regular
);
expect
(
theme
.
bodyMedium
!.
fontSize
,
14
);
expect
(
theme
.
bodyMedium
!.
letterSpacing
,
0.25
);
//
Caption
Roboto regular 12 0.4
//
Body Small
Roboto regular 12 0.4
expect
(
theme
.
bodySmall
!.
fontFamily
,
'Roboto'
);
expect
(
theme
.
bodySmall
!.
fontWeight
,
regular
);
expect
(
theme
.
bodySmall
!.
fontSize
,
12
);
expect
(
theme
.
bodySmall
!.
letterSpacing
,
0.4
);
//
BUTTON
Roboto medium 14 1.25
//
Label Large
Roboto medium 14 1.25
expect
(
theme
.
labelLarge
!.
fontFamily
,
'Roboto'
);
expect
(
theme
.
labelLarge
!.
fontWeight
,
medium
);
expect
(
theme
.
labelLarge
!.
fontSize
,
14
);
...
...
@@ -219,7 +219,7 @@ void main() {
expect
(
theme
.
labelMedium
!.
fontSize
,
11
);
expect
(
theme
.
labelMedium
!.
letterSpacing
,
1.5
);
//
OVERLINE
Roboto regular 10 1.5
//
Label Small
Roboto regular 10 1.5
expect
(
theme
.
labelSmall
!.
fontFamily
,
'Roboto'
);
expect
(
theme
.
labelSmall
!.
fontWeight
,
regular
);
expect
(
theme
.
labelSmall
!.
fontSize
,
10
);
...
...
packages/flutter/test/widgets/editable_text_test.dart
View file @
f5b65bad
...
...
@@ -142,7 +142,7 @@ void main() {
showSelectionHandles:
true
,
autofocus:
true
,
focusNode:
focusNode
,
style:
Typography
.
material2018
().
black
.
subtitle1
!,
style:
Typography
.
material2018
().
black
.
titleMedium
!,
cursorColor:
Colors
.
blue
,
backgroundCursorColor:
Colors
.
grey
,
keyboardType:
TextInputType
.
text
,
...
...
@@ -9080,7 +9080,7 @@ void main() {
showSelectionHandles:
true
,
autofocus:
true
,
focusNode:
focusNode
,
style:
Typography
.
material2018
().
black
.
subtitle1
!,
style:
Typography
.
material2018
().
black
.
titleMedium
!,
cursorColor:
Colors
.
blue
,
backgroundCursorColor:
Colors
.
grey
,
selectionControls:
materialTextSelectionControls
,
...
...
@@ -9174,7 +9174,7 @@ void main() {
showSelectionHandles:
true
,
autofocus:
true
,
focusNode:
focusNode
,
style:
Typography
.
material2018
().
black
.
subtitle1
!,
style:
Typography
.
material2018
().
black
.
titleMedium
!,
cursorColor:
Colors
.
blue
,
backgroundCursorColor:
Colors
.
grey
,
selectionControls:
materialTextSelectionControls
,
...
...
@@ -14993,7 +14993,7 @@ void main() {
showSelectionHandles:
true
,
autofocus:
true
,
focusNode:
focusNode
,
style:
Typography
.
material2018
().
black
.
subtitle1
!,
style:
Typography
.
material2018
().
black
.
titleMedium
!,
cursorColor:
Colors
.
blue
,
backgroundCursorColor:
Colors
.
grey
,
keyboardType:
TextInputType
.
text
,
...
...
@@ -15050,7 +15050,7 @@ void main() {
showSelectionHandles:
true
,
autofocus:
true
,
focusNode:
focusNode
,
style:
Typography
.
material2018
().
black
.
subtitle1
!,
style:
Typography
.
material2018
().
black
.
titleMedium
!,
cursorColor:
Colors
.
blue
,
backgroundCursorColor:
Colors
.
grey
,
keyboardType:
TextInputType
.
text
,
...
...
@@ -15118,7 +15118,7 @@ void main() {
showSelectionHandles:
true
,
autofocus:
true
,
focusNode:
focusNode
,
style:
Typography
.
material2018
().
black
.
subtitle1
!,
style:
Typography
.
material2018
().
black
.
titleMedium
!,
cursorColor:
Colors
.
blue
,
backgroundCursorColor:
Colors
.
grey
,
keyboardType:
TextInputType
.
text
,
...
...
@@ -15191,7 +15191,7 @@ void main() {
showSelectionHandles:
true
,
autofocus:
true
,
focusNode:
focusNode
,
style:
Typography
.
material2018
().
black
.
subtitle1
!,
style:
Typography
.
material2018
().
black
.
titleMedium
!,
cursorColor:
Colors
.
blue
,
backgroundCursorColor:
Colors
.
grey
,
keyboardType:
TextInputType
.
text
,
...
...
@@ -15252,7 +15252,7 @@ void main() {
showSelectionHandles:
true
,
autofocus:
true
,
focusNode:
focusNode
,
style:
Typography
.
material2018
().
black
.
subtitle1
!,
style:
Typography
.
material2018
().
black
.
titleMedium
!,
cursorColor:
Colors
.
blue
,
backgroundCursorColor:
Colors
.
grey
,
keyboardType:
TextInputType
.
text
,
...
...
@@ -15329,7 +15329,7 @@ void main() {
showSelectionHandles:
true
,
autofocus:
true
,
focusNode:
focusNode
,
style:
Typography
.
material2018
().
black
.
subtitle1
!,
style:
Typography
.
material2018
().
black
.
titleMedium
!,
cursorColor:
Colors
.
blue
,
backgroundCursorColor:
Colors
.
grey
,
keyboardType:
TextInputType
.
text
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment