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
21a6c064
Unverified
Commit
21a6c064
authored
Feb 11, 2022
by
Darren Austin
Committed by
GitHub
Feb 11, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update Material tokens to v0.81. (#98149)
parent
21de8505
Changes
38
Hide whitespace changes
Inline
Side-by-side
Showing
38 changed files
with
63 additions
and
300 deletions
+63
-300
gen_defaults.dart
dev/tools/gen_defaults/bin/gen_defaults.dart
+5
-12
assist_chip.json
dev/tools/gen_defaults/data/assist_chip.json
+1
-1
banner.json
dev/tools/gen_defaults/data/banner.json
+1
-1
color_dark.json
dev/tools/gen_defaults/data/color_dark.json
+2
-1
color_light.json
dev/tools/gen_defaults/data/color_light.json
+2
-1
dialog.json
dev/tools/gen_defaults/data/dialog.json
+1
-1
elevation.json
dev/tools/gen_defaults/data/elevation.json
+2
-3
fab_extended_primary.json
dev/tools/gen_defaults/data/fab_extended_primary.json
+1
-1
fab_extended_secondary.json
dev/tools/gen_defaults/data/fab_extended_secondary.json
+0
-32
fab_extended_surface.json
dev/tools/gen_defaults/data/fab_extended_surface.json
+0
-33
fab_large_primary.json
dev/tools/gen_defaults/data/fab_large_primary.json
+1
-1
fab_large_secondary.json
dev/tools/gen_defaults/data/fab_large_secondary.json
+0
-28
fab_large_surface.json
dev/tools/gen_defaults/data/fab_large_surface.json
+0
-29
fab_primary.json
dev/tools/gen_defaults/data/fab_primary.json
+1
-1
fab_secondary.json
dev/tools/gen_defaults/data/fab_secondary.json
+0
-28
fab_small_primary.json
dev/tools/gen_defaults/data/fab_small_primary.json
+1
-1
fab_small_secondary.json
dev/tools/gen_defaults/data/fab_small_secondary.json
+0
-28
fab_small_surface.json
dev/tools/gen_defaults/data/fab_small_surface.json
+0
-29
fab_surface.json
dev/tools/gen_defaults/data/fab_surface.json
+0
-29
filter_chip.json
dev/tools/gen_defaults/data/filter_chip.json
+1
-1
input_chip.json
dev/tools/gen_defaults/data/input_chip.json
+1
-1
motion.json
dev/tools/gen_defaults/data/motion.json
+1
-1
navigation_bar.json
dev/tools/gen_defaults/data/navigation_bar.json
+2
-2
palette.json
dev/tools/gen_defaults/data/palette.json
+1
-1
shape.json
dev/tools/gen_defaults/data/shape.json
+1
-1
slider.json
dev/tools/gen_defaults/data/slider.json
+1
-1
state.json
dev/tools/gen_defaults/data/state.json
+1
-1
suggestion_chip.json
dev/tools/gen_defaults/data/suggestion_chip.json
+1
-1
text_style.json
dev/tools/gen_defaults/data/text_style.json
+1
-1
top_app_bar_large.json
dev/tools/gen_defaults/data/top_app_bar_large.json
+1
-1
top_app_bar_medium.json
dev/tools/gen_defaults/data/top_app_bar_medium.json
+1
-1
top_app_bar_small.json
dev/tools/gen_defaults/data/top_app_bar_small.json
+1
-1
typeface.json
dev/tools/gen_defaults/data/typeface.json
+1
-1
fab_template.dart
dev/tools/gen_defaults/lib/fab_template.dart
+8
-8
template.dart
dev/tools/gen_defaults/lib/template.dart
+19
-14
gen_defaults_test.dart
dev/tools/gen_defaults/test/gen_defaults_test.dart
+1
-1
floating_action_button.dart
...ages/flutter/lib/src/material/floating_action_button.dart
+1
-1
typography.dart
packages/flutter/lib/src/material/typography.dart
+1
-1
No files found.
dev/tools/gen_defaults/bin/gen_defaults.dart
View file @
21a6c064
...
@@ -34,17 +34,9 @@ Future<void> main(List<String> args) async {
...
@@ -34,17 +34,9 @@ Future<void> main(List<String> args) async {
'dialog.json'
,
'dialog.json'
,
'elevation.json'
,
'elevation.json'
,
'fab_extended_primary.json'
,
'fab_extended_primary.json'
,
'fab_extended_secondary.json'
,
'fab_extended_surface.json'
,
'fab_large_primary.json'
,
'fab_large_primary.json'
,
'fab_large_secondary.json'
,
'fab_large_surface.json'
,
'fab_primary.json'
,
'fab_primary.json'
,
'fab_secondary.json'
,
'fab_small_primary.json'
,
'fab_small_primary.json'
,
'fab_small_secondary.json'
,
'fab_small_surface.json'
,
'fab_surface.json'
,
'filter_chip.json'
,
'filter_chip.json'
,
'input_chip.json'
,
'input_chip.json'
,
'motion.json'
,
'motion.json'
,
...
@@ -61,15 +53,16 @@ Future<void> main(List<String> args) async {
...
@@ -61,15 +53,16 @@ Future<void> main(List<String> args) async {
'typeface.json'
,
'typeface.json'
,
];
];
// Generate a map with all the tokens to simplify the template interface.
final
Map
<
String
,
dynamic
>
tokens
=
<
String
,
dynamic
>{};
final
Map
<
String
,
dynamic
>
tokens
=
<
String
,
dynamic
>{};
// Special case the light and dark color schemes.
tokens
[
'colorsLight'
]
=
_readTokenFile
(
'color_light.json'
);
tokens
[
'colorsDark'
]
=
_readTokenFile
(
'color_dark.json'
);
for
(
final
String
tokenFile
in
tokenFiles
)
{
for
(
final
String
tokenFile
in
tokenFiles
)
{
tokens
.
addAll
(
_readTokenFile
(
tokenFile
));
tokens
.
addAll
(
_readTokenFile
(
tokenFile
));
}
}
// Special case the light and dark color schemes.
tokens
[
'colorsLight'
]
=
_readTokenFile
(
'color_light.json'
);
tokens
[
'colorsDark'
]
=
_readTokenFile
(
'color_dark.json'
);
FABTemplate
(
'
$materialLib
/floating_action_button.dart'
,
tokens
).
updateFile
();
FABTemplate
(
'
$materialLib
/floating_action_button.dart'
,
tokens
).
updateFile
();
TypographyTemplate
(
'
$materialLib
/typography.dart'
,
tokens
).
updateFile
();
TypographyTemplate
(
'
$materialLib
/typography.dart'
,
tokens
).
updateFile
();
}
}
dev/tools/gen_defaults/data/assist_chip.json
View file @
21a6c064
{
{
"version"
:
"v0_
76
"
,
"version"
:
"v0_
81
"
,
"md.comp.assist-chip.container.height"
:
32.0
,
"md.comp.assist-chip.container.height"
:
32.0
,
"md.comp.assist-chip.container.shape"
:
"md.sys.shape.corner.small"
,
"md.comp.assist-chip.container.shape"
:
"md.sys.shape.corner.small"
,
...
...
dev/tools/gen_defaults/data/banner.json
View file @
21a6c064
{
{
"version"
:
"v0_
76
"
,
"version"
:
"v0_
81
"
,
"md.comp.banner.action.focus.label-text.color"
:
"primary"
,
"md.comp.banner.action.focus.label-text.color"
:
"primary"
,
"md.comp.banner.action.focus.state-layer.color"
:
"primary"
,
"md.comp.banner.action.focus.state-layer.color"
:
"primary"
,
...
...
dev/tools/gen_defaults/data/color_dark.json
View file @
21a6c064
{
{
"version"
:
"v0_
76
"
,
"version"
:
"v0_
81
"
,
"md.sys.color.background"
:
"md.ref.palette.neutral10"
,
"md.sys.color.background"
:
"md.ref.palette.neutral10"
,
"md.sys.color.error"
:
"md.ref.palette.error80"
,
"md.sys.color.error"
:
"md.ref.palette.error80"
,
...
@@ -25,6 +25,7 @@
...
@@ -25,6 +25,7 @@
"md.sys.color.secondary-container"
:
"md.ref.palette.secondary30"
,
"md.sys.color.secondary-container"
:
"md.ref.palette.secondary30"
,
"md.sys.color.shadow"
:
"md.ref.palette.neutral0"
,
"md.sys.color.shadow"
:
"md.ref.palette.neutral0"
,
"md.sys.color.surface"
:
"md.ref.palette.neutral10"
,
"md.sys.color.surface"
:
"md.ref.palette.neutral10"
,
"md.sys.color.surface-tint-color"
:
"primary"
,
"md.sys.color.surface-variant"
:
"md.ref.palette.neutral-variant30"
,
"md.sys.color.surface-variant"
:
"md.ref.palette.neutral-variant30"
,
"md.sys.color.tertiary"
:
"md.ref.palette.tertiary80"
,
"md.sys.color.tertiary"
:
"md.ref.palette.tertiary80"
,
"md.sys.color.tertiary-container"
:
"md.ref.palette.tertiary30"
"md.sys.color.tertiary-container"
:
"md.ref.palette.tertiary30"
...
...
dev/tools/gen_defaults/data/color_light.json
View file @
21a6c064
{
{
"version"
:
"v0_
76
"
,
"version"
:
"v0_
81
"
,
"md.sys.color.background"
:
"md.ref.palette.neutral99"
,
"md.sys.color.background"
:
"md.ref.palette.neutral99"
,
"md.sys.color.error"
:
"md.ref.palette.error40"
,
"md.sys.color.error"
:
"md.ref.palette.error40"
,
...
@@ -25,6 +25,7 @@
...
@@ -25,6 +25,7 @@
"md.sys.color.secondary-container"
:
"md.ref.palette.secondary90"
,
"md.sys.color.secondary-container"
:
"md.ref.palette.secondary90"
,
"md.sys.color.shadow"
:
"md.ref.palette.neutral0"
,
"md.sys.color.shadow"
:
"md.ref.palette.neutral0"
,
"md.sys.color.surface"
:
"md.ref.palette.neutral99"
,
"md.sys.color.surface"
:
"md.ref.palette.neutral99"
,
"md.sys.color.surface-tint-color"
:
"primary"
,
"md.sys.color.surface-variant"
:
"md.ref.palette.neutral-variant90"
,
"md.sys.color.surface-variant"
:
"md.ref.palette.neutral-variant90"
,
"md.sys.color.tertiary"
:
"md.ref.palette.tertiary40"
,
"md.sys.color.tertiary"
:
"md.ref.palette.tertiary40"
,
"md.sys.color.tertiary-container"
:
"md.ref.palette.tertiary90"
"md.sys.color.tertiary-container"
:
"md.ref.palette.tertiary90"
...
...
dev/tools/gen_defaults/data/dialog.json
View file @
21a6c064
{
{
"version"
:
"v0_
76
"
,
"version"
:
"v0_
81
"
,
"md.comp.dialog.action.focus.label-text.color"
:
"primary"
,
"md.comp.dialog.action.focus.label-text.color"
:
"primary"
,
"md.comp.dialog.action.focus.state-layer.color"
:
"primary"
,
"md.comp.dialog.action.focus.state-layer.color"
:
"primary"
,
...
...
dev/tools/gen_defaults/data/elevation.json
View file @
21a6c064
{
{
"version"
:
"v0_
76
"
,
"version"
:
"v0_
81
"
,
"md.sys.elevation.level0"
:
0.0
,
"md.sys.elevation.level0"
:
0.0
,
"md.sys.elevation.level1"
:
1.0
,
"md.sys.elevation.level1"
:
1.0
,
"md.sys.elevation.level2"
:
3.0
,
"md.sys.elevation.level2"
:
3.0
,
"md.sys.elevation.level3"
:
6.0
,
"md.sys.elevation.level3"
:
6.0
,
"md.sys.elevation.level4"
:
8.0
,
"md.sys.elevation.level4"
:
8.0
,
"md.sys.elevation.level5"
:
12.0
,
"md.sys.elevation.level5"
:
12.0
"md.sys.elevation.surface-tint-color"
:
"primary"
}
}
dev/tools/gen_defaults/data/fab_extended_primary.json
View file @
21a6c064
{
{
"version"
:
"v0_
76
"
,
"version"
:
"v0_
81
"
,
"md.comp.extended-fab.primary.container.color"
:
"primaryContainer"
,
"md.comp.extended-fab.primary.container.color"
:
"primaryContainer"
,
"md.comp.extended-fab.primary.container.elevation"
:
"md.sys.elevation.level3"
,
"md.comp.extended-fab.primary.container.elevation"
:
"md.sys.elevation.level3"
,
...
...
dev/tools/gen_defaults/data/fab_extended_secondary.json
deleted
100644 → 0
View file @
21de8505
{
"version"
:
"v0_76"
,
"md.comp.extended-fab.secondary.container.color"
:
"secondaryContainer"
,
"md.comp.extended-fab.secondary.container.elevation"
:
"md.sys.elevation.level3"
,
"md.comp.extended-fab.secondary.container.height"
:
56.0
,
"md.comp.extended-fab.secondary.container.shadow-color"
:
"shadow"
,
"md.comp.extended-fab.secondary.container.shape"
:
"md.sys.shape.corner.large"
,
"md.comp.extended-fab.secondary.focus.container.elevation"
:
"md.sys.elevation.level3"
,
"md.comp.extended-fab.secondary.focus.icon.color"
:
"onSecondaryContainer"
,
"md.comp.extended-fab.secondary.focus.label-text.color"
:
"onSecondaryContainer"
,
"md.comp.extended-fab.secondary.focus.state-layer.color"
:
"onSecondaryContainer"
,
"md.comp.extended-fab.secondary.focus.state-layer.opacity"
:
"md.sys.state.focus.state-layer-opacity"
,
"md.comp.extended-fab.secondary.hover.container.elevation"
:
"md.sys.elevation.level4"
,
"md.comp.extended-fab.secondary.hover.icon.color"
:
"onSecondaryContainer"
,
"md.comp.extended-fab.secondary.hover.label-text.color"
:
"onSecondaryContainer"
,
"md.comp.extended-fab.secondary.hover.state-layer.color"
:
"onSecondaryContainer"
,
"md.comp.extended-fab.secondary.hover.state-layer.opacity"
:
"md.sys.state.hover.state-layer-opacity"
,
"md.comp.extended-fab.secondary.icon.color"
:
"onSecondaryContainer"
,
"md.comp.extended-fab.secondary.icon.size"
:
24.0
,
"md.comp.extended-fab.secondary.label-text.color"
:
"onSecondaryContainer"
,
"md.comp.extended-fab.secondary.label-text.text-style"
:
"labelLarge"
,
"md.comp.extended-fab.secondary.lowered.container.elevation"
:
"md.sys.elevation.level1"
,
"md.comp.extended-fab.secondary.lowered.focus.container.elevation"
:
"md.sys.elevation.level1"
,
"md.comp.extended-fab.secondary.lowered.hover.container.elevation"
:
"md.sys.elevation.level2"
,
"md.comp.extended-fab.secondary.lowered.pressed.container.elevation"
:
"md.sys.elevation.level1"
,
"md.comp.extended-fab.secondary.pressed.container.elevation"
:
"md.sys.elevation.level3"
,
"md.comp.extended-fab.secondary.pressed.icon.color"
:
"onSecondaryContainer"
,
"md.comp.extended-fab.secondary.pressed.label-text.color"
:
"onSecondaryContainer"
,
"md.comp.extended-fab.secondary.pressed.state-layer.color"
:
"onSecondaryContainer"
,
"md.comp.extended-fab.secondary.pressed.state-layer.opacity"
:
"md.sys.state.pressed.state-layer-opacity"
}
dev/tools/gen_defaults/data/fab_extended_surface.json
deleted
100644 → 0
View file @
21de8505
{
"version"
:
"v0_76"
,
"md.comp.extended-fab.surface.container.color"
:
"surface"
,
"md.comp.extended-fab.surface.container.elevation"
:
"md.sys.elevation.level3"
,
"md.comp.extended-fab.surface.container.height"
:
56.0
,
"md.comp.extended-fab.surface.container.shadow-color"
:
"shadow"
,
"md.comp.extended-fab.surface.container.shape"
:
"md.sys.shape.corner.large"
,
"md.comp.extended-fab.surface.container.surface-tint-layer.color"
:
"surfaceTintColor"
,
"md.comp.extended-fab.surface.focus.container.elevation"
:
"md.sys.elevation.level3"
,
"md.comp.extended-fab.surface.focus.icon.color"
:
"primary"
,
"md.comp.extended-fab.surface.focus.label-text.color"
:
"primary"
,
"md.comp.extended-fab.surface.focus.state-layer.color"
:
"primary"
,
"md.comp.extended-fab.surface.focus.state-layer.opacity"
:
"md.sys.state.focus.state-layer-opacity"
,
"md.comp.extended-fab.surface.hover.container.elevation"
:
"md.sys.elevation.level4"
,
"md.comp.extended-fab.surface.hover.icon.color"
:
"primary"
,
"md.comp.extended-fab.surface.hover.label-text.color"
:
"primary"
,
"md.comp.extended-fab.surface.hover.state-layer.color"
:
"primary"
,
"md.comp.extended-fab.surface.hover.state-layer.opacity"
:
"md.sys.state.hover.state-layer-opacity"
,
"md.comp.extended-fab.surface.icon.color"
:
"primary"
,
"md.comp.extended-fab.surface.icon.size"
:
24.0
,
"md.comp.extended-fab.surface.label-text.color"
:
"primary"
,
"md.comp.extended-fab.surface.label-text.text-style"
:
"labelLarge"
,
"md.comp.extended-fab.surface.lowered.container.elevation"
:
"md.sys.elevation.level1"
,
"md.comp.extended-fab.surface.lowered.focus.container.elevation"
:
"md.sys.elevation.level1"
,
"md.comp.extended-fab.surface.lowered.hover.container.elevation"
:
"md.sys.elevation.level2"
,
"md.comp.extended-fab.surface.lowered.pressed.container.elevation"
:
"md.sys.elevation.level1"
,
"md.comp.extended-fab.surface.pressed.container.elevation"
:
"md.sys.elevation.level3"
,
"md.comp.extended-fab.surface.pressed.icon.color"
:
"primary"
,
"md.comp.extended-fab.surface.pressed.label-text.color"
:
"primary"
,
"md.comp.extended-fab.surface.pressed.state-layer.color"
:
"primary"
,
"md.comp.extended-fab.surface.pressed.state-layer.opacity"
:
"md.sys.state.pressed.state-layer-opacity"
}
dev/tools/gen_defaults/data/fab_large_primary.json
View file @
21a6c064
{
{
"version"
:
"v0_
76
"
,
"version"
:
"v0_
81
"
,
"md.comp.fab.primary.large.container.color"
:
"primaryContainer"
,
"md.comp.fab.primary.large.container.color"
:
"primaryContainer"
,
"md.comp.fab.primary.large.container.elevation"
:
"md.sys.elevation.level3"
,
"md.comp.fab.primary.large.container.elevation"
:
"md.sys.elevation.level3"
,
...
...
dev/tools/gen_defaults/data/fab_large_secondary.json
deleted
100644 → 0
View file @
21de8505
{
"version"
:
"v0_76"
,
"md.comp.fab.secondary.large.container.color"
:
"secondaryContainer"
,
"md.comp.fab.secondary.large.container.elevation"
:
"md.sys.elevation.level3"
,
"md.comp.fab.secondary.large.container.height"
:
96.0
,
"md.comp.fab.secondary.large.container.shadow-color"
:
"shadow"
,
"md.comp.fab.secondary.large.container.shape"
:
"md.sys.shape.corner.extra-large"
,
"md.comp.fab.secondary.large.container.width"
:
96.0
,
"md.comp.fab.secondary.large.focus.container.elevation"
:
"md.sys.elevation.level3"
,
"md.comp.fab.secondary.large.focus.icon.color"
:
"onSecondaryContainer"
,
"md.comp.fab.secondary.large.focus.state-layer.color"
:
"onSecondaryContainer"
,
"md.comp.fab.secondary.large.focus.state-layer.opacity"
:
"md.sys.state.focus.state-layer-opacity"
,
"md.comp.fab.secondary.large.hover.container.elevation"
:
"md.sys.elevation.level4"
,
"md.comp.fab.secondary.large.hover.icon.color"
:
"onSecondaryContainer"
,
"md.comp.fab.secondary.large.hover.state-layer.color"
:
"onSecondaryContainer"
,
"md.comp.fab.secondary.large.hover.state-layer.opacity"
:
"md.sys.state.hover.state-layer-opacity"
,
"md.comp.fab.secondary.large.icon.color"
:
"onSecondaryContainer"
,
"md.comp.fab.secondary.large.icon.size"
:
36.0
,
"md.comp.fab.secondary.large.lowered.container.elevation"
:
"md.sys.elevation.level1"
,
"md.comp.fab.secondary.large.lowered.focus.container.elevation"
:
"md.sys.elevation.level1"
,
"md.comp.fab.secondary.large.lowered.hover.container.elevation"
:
"md.sys.elevation.level2"
,
"md.comp.fab.secondary.large.lowered.pressed.container.elevation"
:
"md.sys.elevation.level1"
,
"md.comp.fab.secondary.large.pressed.container.elevation"
:
"md.sys.elevation.level3"
,
"md.comp.fab.secondary.large.pressed.icon.color"
:
"onSecondaryContainer"
,
"md.comp.fab.secondary.large.pressed.state-layer.color"
:
"onSecondaryContainer"
,
"md.comp.fab.secondary.large.pressed.state-layer.opacity"
:
"md.sys.state.pressed.state-layer-opacity"
}
dev/tools/gen_defaults/data/fab_large_surface.json
deleted
100644 → 0
View file @
21de8505
{
"version"
:
"v0_76"
,
"md.comp.fab.surface.large.container.color"
:
"surface"
,
"md.comp.fab.surface.large.container.elevation"
:
"md.sys.elevation.level3"
,
"md.comp.fab.surface.large.container.height"
:
96.0
,
"md.comp.fab.surface.large.container.shadow-color"
:
"shadow"
,
"md.comp.fab.surface.large.container.shape"
:
"md.sys.shape.corner.extra-large"
,
"md.comp.fab.surface.large.container.surface-tint-layer.color"
:
"surfaceTintColor"
,
"md.comp.fab.surface.large.container.width"
:
96.0
,
"md.comp.fab.surface.large.focus.container.elevation"
:
"md.sys.elevation.level3"
,
"md.comp.fab.surface.large.focus.icon.color"
:
"primary"
,
"md.comp.fab.surface.large.focus.state-layer.color"
:
"primary"
,
"md.comp.fab.surface.large.focus.state-layer.opacity"
:
"md.sys.state.focus.state-layer-opacity"
,
"md.comp.fab.surface.large.hover.container.elevation"
:
"md.sys.elevation.level4"
,
"md.comp.fab.surface.large.hover.icon.color"
:
"primary"
,
"md.comp.fab.surface.large.hover.state-layer.color"
:
"primary"
,
"md.comp.fab.surface.large.hover.state-layer.opacity"
:
"md.sys.state.hover.state-layer-opacity"
,
"md.comp.fab.surface.large.icon.color"
:
"primary"
,
"md.comp.fab.surface.large.icon.size"
:
36.0
,
"md.comp.fab.surface.large.lowered.container.elevation"
:
"md.sys.elevation.level1"
,
"md.comp.fab.surface.large.lowered.focus.container.elevation"
:
"md.sys.elevation.level1"
,
"md.comp.fab.surface.large.lowered.hover.container.elevation"
:
"md.sys.elevation.level2"
,
"md.comp.fab.surface.large.lowered.pressed.container.elevation"
:
"md.sys.elevation.level1"
,
"md.comp.fab.surface.large.pressed.container.elevation"
:
"md.sys.elevation.level3"
,
"md.comp.fab.surface.large.pressed.icon.color"
:
"primary"
,
"md.comp.fab.surface.large.pressed.state-layer.color"
:
"primary"
,
"md.comp.fab.surface.large.pressed.state-layer.opacity"
:
"md.sys.state.pressed.state-layer-opacity"
}
dev/tools/gen_defaults/data/fab_primary.json
View file @
21a6c064
{
{
"version"
:
"v0_
76
"
,
"version"
:
"v0_
81
"
,
"md.comp.fab.primary.container.color"
:
"primaryContainer"
,
"md.comp.fab.primary.container.color"
:
"primaryContainer"
,
"md.comp.fab.primary.container.elevation"
:
"md.sys.elevation.level3"
,
"md.comp.fab.primary.container.elevation"
:
"md.sys.elevation.level3"
,
...
...
dev/tools/gen_defaults/data/fab_secondary.json
deleted
100644 → 0
View file @
21de8505
{
"version"
:
"v0_76"
,
"md.comp.fab.secondary.container.color"
:
"secondaryContainer"
,
"md.comp.fab.secondary.container.elevation"
:
"md.sys.elevation.level3"
,
"md.comp.fab.secondary.container.height"
:
56.0
,
"md.comp.fab.secondary.container.shadow-color"
:
"shadow"
,
"md.comp.fab.secondary.container.shape"
:
"md.sys.shape.corner.large"
,
"md.comp.fab.secondary.container.width"
:
56.0
,
"md.comp.fab.secondary.focus.container.elevation"
:
"md.sys.elevation.level3"
,
"md.comp.fab.secondary.focus.icon.color"
:
"onSecondaryContainer"
,
"md.comp.fab.secondary.focus.state-layer.color"
:
"onSecondaryContainer"
,
"md.comp.fab.secondary.focus.state-layer.opacity"
:
"md.sys.state.focus.state-layer-opacity"
,
"md.comp.fab.secondary.hover.container.elevation"
:
"md.sys.elevation.level4"
,
"md.comp.fab.secondary.hover.icon.color"
:
"onSecondaryContainer"
,
"md.comp.fab.secondary.hover.state-layer.color"
:
"onSecondaryContainer"
,
"md.comp.fab.secondary.hover.state-layer.opacity"
:
"md.sys.state.hover.state-layer-opacity"
,
"md.comp.fab.secondary.icon.color"
:
"onSecondaryContainer"
,
"md.comp.fab.secondary.icon.size"
:
24.0
,
"md.comp.fab.secondary.lowered.container.elevation"
:
"md.sys.elevation.level1"
,
"md.comp.fab.secondary.lowered.focus.container.elevation"
:
"md.sys.elevation.level1"
,
"md.comp.fab.secondary.lowered.hover.container.elevation"
:
"md.sys.elevation.level2"
,
"md.comp.fab.secondary.lowered.pressed.container.elevation"
:
"md.sys.elevation.level1"
,
"md.comp.fab.secondary.pressed.container.elevation"
:
"md.sys.elevation.level3"
,
"md.comp.fab.secondary.pressed.icon.color"
:
"onSecondaryContainer"
,
"md.comp.fab.secondary.pressed.state-layer.color"
:
"onSecondaryContainer"
,
"md.comp.fab.secondary.pressed.state-layer.opacity"
:
"md.sys.state.pressed.state-layer-opacity"
}
dev/tools/gen_defaults/data/fab_small_primary.json
View file @
21a6c064
{
{
"version"
:
"v0_
76
"
,
"version"
:
"v0_
81
"
,
"md.comp.fab.primary.small.container.color"
:
"primaryContainer"
,
"md.comp.fab.primary.small.container.color"
:
"primaryContainer"
,
"md.comp.fab.primary.small.container.elevation"
:
"md.sys.elevation.level3"
,
"md.comp.fab.primary.small.container.elevation"
:
"md.sys.elevation.level3"
,
...
...
dev/tools/gen_defaults/data/fab_small_secondary.json
deleted
100644 → 0
View file @
21de8505
{
"version"
:
"v0_76"
,
"md.comp.fab.secondary.small.container.color"
:
"secondaryContainer"
,
"md.comp.fab.secondary.small.container.elevation"
:
"md.sys.elevation.level3"
,
"md.comp.fab.secondary.small.container.height"
:
40.0
,
"md.comp.fab.secondary.small.container.shadow-color"
:
"shadow"
,
"md.comp.fab.secondary.small.container.shape"
:
"md.sys.shape.corner.medium"
,
"md.comp.fab.secondary.small.container.width"
:
40.0
,
"md.comp.fab.secondary.small.focus.container.elevation"
:
"md.sys.elevation.level3"
,
"md.comp.fab.secondary.small.focus.icon.color"
:
"onSecondaryContainer"
,
"md.comp.fab.secondary.small.focus.state-layer.color"
:
"onSecondaryContainer"
,
"md.comp.fab.secondary.small.focus.state-layer.opacity"
:
"md.sys.state.focus.state-layer-opacity"
,
"md.comp.fab.secondary.small.hover.container.elevation"
:
"md.sys.elevation.level4"
,
"md.comp.fab.secondary.small.hover.icon.color"
:
"onSecondaryContainer"
,
"md.comp.fab.secondary.small.hover.state-layer.color"
:
"onSecondary"
,
"md.comp.fab.secondary.small.hover.state-layer.opacity"
:
"md.sys.state.hover.state-layer-opacity"
,
"md.comp.fab.secondary.small.icon.color"
:
"onSecondaryContainer"
,
"md.comp.fab.secondary.small.icon.size"
:
24.0
,
"md.comp.fab.secondary.small.lowered.container.elevation"
:
"md.sys.elevation.level1"
,
"md.comp.fab.secondary.small.lowered.focus.container.elevation"
:
"md.sys.elevation.level1"
,
"md.comp.fab.secondary.small.lowered.hover.container.elevation"
:
"md.sys.elevation.level2"
,
"md.comp.fab.secondary.small.lowered.pressed.container.elevation"
:
"md.sys.elevation.level1"
,
"md.comp.fab.secondary.small.pressed.container.elevation"
:
"md.sys.elevation.level3"
,
"md.comp.fab.secondary.small.pressed.icon.color"
:
"onSecondaryContainer"
,
"md.comp.fab.secondary.small.pressed.state-layer.color"
:
"onSecondaryContainer"
,
"md.comp.fab.secondary.small.pressed.state-layer.opacity"
:
"md.sys.state.pressed.state-layer-opacity"
}
dev/tools/gen_defaults/data/fab_small_surface.json
deleted
100644 → 0
View file @
21de8505
{
"version"
:
"v0_76"
,
"md.comp.fab.surface.small.container.color"
:
"surface"
,
"md.comp.fab.surface.small.container.elevation"
:
"md.sys.elevation.level3"
,
"md.comp.fab.surface.small.container.height"
:
40.0
,
"md.comp.fab.surface.small.container.shadow-color"
:
"shadow"
,
"md.comp.fab.surface.small.container.shape"
:
"md.sys.shape.corner.medium"
,
"md.comp.fab.surface.small.container.surface-tint-layer.color"
:
"surfaceTintColor"
,
"md.comp.fab.surface.small.container.width"
:
40.0
,
"md.comp.fab.surface.small.focus.container.elevation"
:
"md.sys.elevation.level3"
,
"md.comp.fab.surface.small.focus.icon.color"
:
"primary"
,
"md.comp.fab.surface.small.focus.state-layer.color"
:
"primary"
,
"md.comp.fab.surface.small.focus.state-layer.opacity"
:
"md.sys.state.focus.state-layer-opacity"
,
"md.comp.fab.surface.small.hover.container.elevation"
:
"md.sys.elevation.level4"
,
"md.comp.fab.surface.small.hover.icon.color"
:
"primary"
,
"md.comp.fab.surface.small.hover.state-layer.color"
:
"primary"
,
"md.comp.fab.surface.small.hover.state-layer.opacity"
:
"md.sys.state.hover.state-layer-opacity"
,
"md.comp.fab.surface.small.icon.color"
:
"primary"
,
"md.comp.fab.surface.small.icon.size"
:
24.0
,
"md.comp.fab.surface.small.lowered.container.elevation"
:
"md.sys.elevation.level1"
,
"md.comp.fab.surface.small.lowered.focus.container.elevation"
:
"md.sys.elevation.level1"
,
"md.comp.fab.surface.small.lowered.hover.container.elevation"
:
"md.sys.elevation.level2"
,
"md.comp.fab.surface.small.lowered.pressed.container.elevation"
:
"md.sys.elevation.level1"
,
"md.comp.fab.surface.small.pressed.container.elevation"
:
"md.sys.elevation.level3"
,
"md.comp.fab.surface.small.pressed.icon.color"
:
"primary"
,
"md.comp.fab.surface.small.pressed.state-layer.color"
:
"primary"
,
"md.comp.fab.surface.small.pressed.state-layer.opacity"
:
"md.sys.state.pressed.state-layer-opacity"
}
dev/tools/gen_defaults/data/fab_surface.json
deleted
100644 → 0
View file @
21de8505
{
"version"
:
"v0_76"
,
"md.comp.fab.surface.container.color"
:
"surface"
,
"md.comp.fab.surface.container.elevation"
:
"md.sys.elevation.level3"
,
"md.comp.fab.surface.container.height"
:
56.0
,
"md.comp.fab.surface.container.shadow-color"
:
"shadow"
,
"md.comp.fab.surface.container.shape"
:
"md.sys.shape.corner.large"
,
"md.comp.fab.surface.container.surface-tint-layer.color"
:
"surfaceTintColor"
,
"md.comp.fab.surface.container.width"
:
56.0
,
"md.comp.fab.surface.focus.container.elevation"
:
"md.sys.elevation.level3"
,
"md.comp.fab.surface.focus.icon.color"
:
"primary"
,
"md.comp.fab.surface.focus.state-layer.color"
:
"primary"
,
"md.comp.fab.surface.focus.state-layer.opacity"
:
"md.sys.state.focus.state-layer-opacity"
,
"md.comp.fab.surface.hover.container.elevation"
:
"md.sys.elevation.level4"
,
"md.comp.fab.surface.hover.icon.color"
:
"primary"
,
"md.comp.fab.surface.hover.state-layer.color"
:
"primary"
,
"md.comp.fab.surface.hover.state-layer.opacity"
:
"md.sys.state.hover.state-layer-opacity"
,
"md.comp.fab.surface.icon.color"
:
"primary"
,
"md.comp.fab.surface.icon.size"
:
24.0
,
"md.comp.fab.surface.lowered.container.elevation"
:
"md.sys.elevation.level1"
,
"md.comp.fab.surface.lowered.focus.container.elevation"
:
"md.sys.elevation.level1"
,
"md.comp.fab.surface.lowered.hover.container.elevation"
:
"md.sys.elevation.level2"
,
"md.comp.fab.surface.lowered.pressed.container.elevation"
:
"md.sys.elevation.level1"
,
"md.comp.fab.surface.pressed.container.elevation"
:
"md.sys.elevation.level3"
,
"md.comp.fab.surface.pressed.icon.color"
:
"primary"
,
"md.comp.fab.surface.pressed.state-layer.color"
:
"primary"
,
"md.comp.fab.surface.pressed.state-layer.opacity"
:
"md.sys.state.pressed.state-layer-opacity"
}
dev/tools/gen_defaults/data/filter_chip.json
View file @
21a6c064
{
{
"version"
:
"v0_
76
"
,
"version"
:
"v0_
81
"
,
"md.comp.filter-chip.container.height"
:
32.0
,
"md.comp.filter-chip.container.height"
:
32.0
,
"md.comp.filter-chip.container.shadow-color"
:
"shadow"
,
"md.comp.filter-chip.container.shadow-color"
:
"shadow"
,
...
...
dev/tools/gen_defaults/data/input_chip.json
View file @
21a6c064
{
{
"version"
:
"v0_
76
"
,
"version"
:
"v0_
81
"
,
"md.comp.input-chip.container.elevation"
:
"md.sys.elevation.level0"
,
"md.comp.input-chip.container.elevation"
:
"md.sys.elevation.level0"
,
"md.comp.input-chip.container.height"
:
32.0
,
"md.comp.input-chip.container.height"
:
32.0
,
...
...
dev/tools/gen_defaults/data/motion.json
View file @
21a6c064
{
{
"version"
:
"v0_
76
"
,
"version"
:
"v0_
81
"
,
"md.sys.motion.duration.100Ms"
:
100.0
,
"md.sys.motion.duration.100Ms"
:
100.0
,
"md.sys.motion.duration.1000Ms"
:
1000.0
,
"md.sys.motion.duration.1000Ms"
:
1000.0
,
...
...
dev/tools/gen_defaults/data/navigation_bar.json
View file @
21a6c064
{
{
"version"
:
"v0_
76
"
,
"version"
:
"v0_
81
"
,
"md.comp.navigation-bar.active.focus.icon.color"
:
"onSecondaryContainer"
,
"md.comp.navigation-bar.active.focus.icon.color"
:
"onSecondaryContainer"
,
"md.comp.navigation-bar.active.focus.label-text.color"
:
"onSurface"
,
"md.comp.navigation-bar.active.focus.label-text.color"
:
"onSurface"
,
...
@@ -10,7 +10,7 @@
...
@@ -10,7 +10,7 @@
"md.comp.navigation-bar.active.icon.color"
:
"onSecondaryContainer"
,
"md.comp.navigation-bar.active.icon.color"
:
"onSecondaryContainer"
,
"md.comp.navigation-bar.active-indicator.color"
:
"secondaryContainer"
,
"md.comp.navigation-bar.active-indicator.color"
:
"secondaryContainer"
,
"md.comp.navigation-bar.active-indicator.height"
:
32.0
,
"md.comp.navigation-bar.active-indicator.height"
:
32.0
,
"md.comp.navigation-bar.active-indicator.shape"
:
"md.sys.shape.corner.
large
"
,
"md.comp.navigation-bar.active-indicator.shape"
:
"md.sys.shape.corner.
full
"
,
"md.comp.navigation-bar.active-indicator.width"
:
64.0
,
"md.comp.navigation-bar.active-indicator.width"
:
64.0
,
"md.comp.navigation-bar.active.label-text.color"
:
"onSurface"
,
"md.comp.navigation-bar.active.label-text.color"
:
"onSurface"
,
"md.comp.navigation-bar.active.pressed.icon.color"
:
"onSecondaryContainer"
,
"md.comp.navigation-bar.active.pressed.icon.color"
:
"onSecondaryContainer"
,
...
...
dev/tools/gen_defaults/data/palette.json
View file @
21a6c064
{
{
"version"
:
"v0_
76
"
,
"version"
:
"v0_
81
"
,
"md.ref.palette.black"
:
"0xFF000000"
,
"md.ref.palette.black"
:
"0xFF000000"
,
"md.ref.palette.error0"
:
"0xFF000000"
,
"md.ref.palette.error0"
:
"0xFF000000"
,
...
...
dev/tools/gen_defaults/data/shape.json
View file @
21a6c064
{
{
"version"
:
"v0_
76
"
,
"version"
:
"v0_
81
"
,
"md.sys.shape.corner.extra-large"
:
{
"md.sys.shape.corner.extra-large"
:
{
"family"
:
"SHAPE_FAMILY_ROUNDED_CORNERS"
,
"family"
:
"SHAPE_FAMILY_ROUNDED_CORNERS"
,
...
...
dev/tools/gen_defaults/data/slider.json
View file @
21a6c064
{
{
"version"
:
"v0_
76
"
,
"version"
:
"v0_
81
"
,
"md.comp.slider.active.track.color"
:
"primary"
,
"md.comp.slider.active.track.color"
:
"primary"
,
"md.comp.slider.active.track.height"
:
6.0
,
"md.comp.slider.active.track.height"
:
6.0
,
...
...
dev/tools/gen_defaults/data/state.json
View file @
21a6c064
{
{
"version"
:
"v0_
76
"
,
"version"
:
"v0_
81
"
,
"md.sys.state.dragged.state-layer-opacity"
:
0.16
,
"md.sys.state.dragged.state-layer-opacity"
:
0.16
,
"md.sys.state.focus.state-layer-opacity"
:
0.12
,
"md.sys.state.focus.state-layer-opacity"
:
0.12
,
...
...
dev/tools/gen_defaults/data/suggestion_chip.json
View file @
21a6c064
{
{
"version"
:
"v0_
76
"
,
"version"
:
"v0_
81
"
,
"md.comp.suggestion-chip.container.height"
:
32.0
,
"md.comp.suggestion-chip.container.height"
:
32.0
,
"md.comp.suggestion-chip.container.shape"
:
"md.sys.shape.corner.small"
,
"md.comp.suggestion-chip.container.shape"
:
"md.sys.shape.corner.small"
,
...
...
dev/tools/gen_defaults/data/text_style.json
View file @
21a6c064
{
{
"version"
:
"v0_
76
"
,
"version"
:
"v0_
81
"
,
"md.sys.typescale.body-large.font"
:
"md.ref.typeface.plain"
,
"md.sys.typescale.body-large.font"
:
"md.ref.typeface.plain"
,
"md.sys.typescale.body-large.line-height"
:
24.0
,
"md.sys.typescale.body-large.line-height"
:
24.0
,
...
...
dev/tools/gen_defaults/data/top_app_bar_large.json
View file @
21a6c064
{
{
"version"
:
"v0_
76
"
,
"version"
:
"v0_
81
"
,
"md.comp.top-app-bar.large.container.color"
:
"surface"
,
"md.comp.top-app-bar.large.container.color"
:
"surface"
,
"md.comp.top-app-bar.large.container.elevation"
:
"md.sys.elevation.level0"
,
"md.comp.top-app-bar.large.container.elevation"
:
"md.sys.elevation.level0"
,
...
...
dev/tools/gen_defaults/data/top_app_bar_medium.json
View file @
21a6c064
{
{
"version"
:
"v0_
76
"
,
"version"
:
"v0_
81
"
,
"md.comp.top-app-bar.medium.container.color"
:
"surface"
,
"md.comp.top-app-bar.medium.container.color"
:
"surface"
,
"md.comp.top-app-bar.medium.container.elevation"
:
"md.sys.elevation.level0"
,
"md.comp.top-app-bar.medium.container.elevation"
:
"md.sys.elevation.level0"
,
...
...
dev/tools/gen_defaults/data/top_app_bar_small.json
View file @
21a6c064
{
{
"version"
:
"v0_
76
"
,
"version"
:
"v0_
81
"
,
"md.comp.top-app-bar.small.container.color"
:
"surface"
,
"md.comp.top-app-bar.small.container.color"
:
"surface"
,
"md.comp.top-app-bar.small.container.elevation"
:
"md.sys.elevation.level0"
,
"md.comp.top-app-bar.small.container.elevation"
:
"md.sys.elevation.level0"
,
...
...
dev/tools/gen_defaults/data/typeface.json
View file @
21a6c064
{
{
"version"
:
"v0_
76
"
,
"version"
:
"v0_
81
"
,
"md.ref.typeface.brand"
:
"Roboto"
,
"md.ref.typeface.brand"
:
"Roboto"
,
"md.ref.typeface.plain"
:
"Roboto"
,
"md.ref.typeface.plain"
:
"Roboto"
,
...
...
dev/tools/gen_defaults/lib/fab_template.dart
View file @
21a6c064
...
@@ -15,10 +15,10 @@ class _M3Defaults extends FloatingActionButtonThemeData {
...
@@ -15,10 +15,10 @@ class _M3Defaults extends FloatingActionButtonThemeData {
: _colors = Theme.of(context).colorScheme,
: _colors = Theme.of(context).colorScheme,
_textTheme = Theme.of(context).textTheme,
_textTheme = Theme.of(context).textTheme,
super(
super(
elevation:
${elevation("md.comp.fab.primary.container
.elevation
")}
,
elevation:
${elevation("md.comp.fab.primary.container")}
,
focusElevation:
${elevation("md.comp.fab.primary.focus.container
.elevation
")}
,
focusElevation:
${elevation("md.comp.fab.primary.focus.container")}
,
hoverElevation:
${elevation("md.comp.fab.primary.hover.container
.elevation
")}
,
hoverElevation:
${elevation("md.comp.fab.primary.hover.container")}
,
highlightElevation:
${elevation("md.comp.fab.primary.pressed.container
.elevation
")}
,
highlightElevation:
${elevation("md.comp.fab.primary.pressed.container")}
,
enableFeedback: true,
enableFeedback: true,
sizeConstraints: const BoxConstraints.tightFor(
sizeConstraints: const BoxConstraints.tightFor(
width:
${tokens["md.comp.fab.primary.container.width"]}
,
width:
${tokens["md.comp.fab.primary.container.width"]}
,
...
@@ -56,13 +56,13 @@ class _M3Defaults extends FloatingActionButtonThemeData {
...
@@ -56,13 +56,13 @@ class _M3Defaults extends FloatingActionButtonThemeData {
ShapeBorder? get shape {
ShapeBorder? get shape {
switch (type) {
switch (type) {
case _FloatingActionButtonType.regular:
case _FloatingActionButtonType.regular:
return
${shape("md.comp.fab.primary.container
.shape
")}
;
return
${shape("md.comp.fab.primary.container")}
;
case _FloatingActionButtonType.small:
case _FloatingActionButtonType.small:
return
${shape("md.comp.fab.primary.small.container
.shape
")}
;
return
${shape("md.comp.fab.primary.small.container")}
;
case _FloatingActionButtonType.large:
case _FloatingActionButtonType.large:
return
${shape("md.comp.fab.primary.large.container
.shape
")}
;
return
${shape("md.comp.fab.primary.large.container")}
;
case _FloatingActionButtonType.extended:
case _FloatingActionButtonType.extended:
return
${shape("md.comp.extended-fab.primary.container
.shape
")}
;
return
${shape("md.comp.extended-fab.primary.container")}
;
}
}
}
}
...
...
dev/tools/gen_defaults/lib/template.dart
View file @
21a6c064
...
@@ -54,9 +54,13 @@ abstract class TokenTemplate {
...
@@ -54,9 +54,13 @@ abstract class TokenTemplate {
/// bottom of the file.
/// bottom of the file.
String
generate
();
String
generate
();
String
color
(
String
tokenName
)
{
/// Generate a [ColorScheme] color name for the given component token.
final
String
tokenColor
=
'
$tokenName
.color'
;
///
final
String
tokenOpacity
=
'
$tokenName
.opacity'
;
/// If there is an opacity specified for the given component, it will
/// apply that opacity to the component's color.
String
color
(
String
componentToken
)
{
final
String
tokenColor
=
'
$componentToken
.color'
;
final
String
tokenOpacity
=
'
$componentToken
.opacity'
;
String
value
=
'
${tokens[tokenColor]!}
'
;
String
value
=
'
${tokens[tokenColor]!}
'
;
if
(
tokens
.
containsKey
(
tokenOpacity
))
{
if
(
tokens
.
containsKey
(
tokenOpacity
))
{
final
String
opacity
=
tokens
[
tokens
[
tokenOpacity
]!]!.
toString
();
final
String
opacity
=
tokens
[
tokens
[
tokenOpacity
]!]!.
toString
();
...
@@ -65,13 +69,18 @@ abstract class TokenTemplate {
...
@@ -65,13 +69,18 @@ abstract class TokenTemplate {
return
value
;
return
value
;
}
}
String
elevation
(
String
tokenName
)
{
/// Generate an elevation value for the given component token.
return
tokens
[
tokens
[
tokenName
]!]!.
toString
();
String
elevation
(
String
componentToken
)
{
return
tokens
[
tokens
[
'
$componentToken
.elevation'
]!]!.
toString
();
}
}
String
shape
(
String
tokenName
)
{
/// Generate a shape constant for the given component token.
///
/// Currently only supports "SHAPE_FAMILY_ROUNDED_CORNERS" which it
/// maps to a [RoundedRectangleBorder] expression.
String
shape
(
String
componentToken
)
{
// TODO(darrenaustin): handle more than just rounded rectangle shapes
// TODO(darrenaustin): handle more than just rounded rectangle shapes
final
Map
<
String
,
dynamic
>
shape
=
tokens
[
tokens
[
tokenName
]!]!
as
Map
<
String
,
dynamic
>;
final
Map
<
String
,
dynamic
>
shape
=
tokens
[
tokens
[
'
$componentToken
.shape'
]!]!
as
Map
<
String
,
dynamic
>;
return
'const RoundedRectangleBorder(borderRadius: '
return
'const RoundedRectangleBorder(borderRadius: '
'BorderRadius.only('
'BorderRadius.only('
'topLeft: Radius.circular(
${shape['topLeft']}
), '
'topLeft: Radius.circular(
${shape['topLeft']}
), '
...
@@ -80,12 +89,8 @@ abstract class TokenTemplate {
...
@@ -80,12 +89,8 @@ abstract class TokenTemplate {
'bottomRight: Radius.circular(
${shape['bottomRight']}
)))'
;
'bottomRight: Radius.circular(
${shape['bottomRight']}
)))'
;
}
}
String
value
(
String
tokenName
)
{
/// Generate a [TextTheme] text style name for the given component token.
final
Map
<
String
,
dynamic
>
value
=
tokens
[
tokenName
]!
as
Map
<
String
,
dynamic
>;
String
textStyle
(
String
componentToken
)
{
return
value
[
'value'
].
toString
();
return
tokens
[
'
$componentToken
.text-style'
]!.
toString
();
}
String
textStyle
(
String
tokenName
)
{
return
tokens
[
'
$tokenName
.text-style'
]!.
toString
();
}
}
}
}
dev/tools/gen_defaults/test/gen_defaults_test.dart
View file @
21a6c064
...
@@ -110,7 +110,7 @@ static final String tokenBar = 'bar';
...
@@ -110,7 +110,7 @@ static final String tokenBar = 'bar';
}
}
};
};
final TestTemplate template = TestTemplate('
foobar
.
dart
', tokens);
final TestTemplate template = TestTemplate('
foobar
.
dart
', tokens);
expect(template.shape('
foo
.
shape
'), '
const
RoundedRectangleBorder
(
borderRadius:
BorderRadius
.
only
(
topLeft:
Radius
.
circular
(
1.0
),
topRight:
Radius
.
circular
(
2.0
),
bottomLeft:
Radius
.
circular
(
3.0
),
bottomRight:
Radius
.
circular
(
4.0
)))
');
expect(template.shape('
foo
'), '
const
RoundedRectangleBorder
(
borderRadius:
BorderRadius
.
only
(
topLeft:
Radius
.
circular
(
1.0
),
topRight:
Radius
.
circular
(
2.0
),
bottomLeft:
Radius
.
circular
(
3.0
),
bottomRight:
Radius
.
circular
(
4.0
)))
');
});
});
}
}
...
...
packages/flutter/lib/src/material/floating_action_button.dart
View file @
21a6c064
...
@@ -773,7 +773,7 @@ class _M2Defaults extends FloatingActionButtonThemeData {
...
@@ -773,7 +773,7 @@ class _M2Defaults extends FloatingActionButtonThemeData {
// These defaults are generated from the Material Design Token
// These defaults are generated from the Material Design Token
// database by the script dev/tools/gen_defaults/bin/gen_defaults.dart.
// database by the script dev/tools/gen_defaults/bin/gen_defaults.dart.
// Generated version v0_
76
// Generated version v0_
81
class
_M3Defaults
extends
FloatingActionButtonThemeData
{
class
_M3Defaults
extends
FloatingActionButtonThemeData
{
_M3Defaults
(
this
.
context
,
this
.
type
,
this
.
hasChild
)
_M3Defaults
(
this
.
context
,
this
.
type
,
this
.
hasChild
)
:
_colors
=
Theme
.
of
(
context
).
colorScheme
,
:
_colors
=
Theme
.
of
(
context
).
colorScheme
,
...
...
packages/flutter/lib/src/material/typography.dart
View file @
21a6c064
...
@@ -731,7 +731,7 @@ class Typography with Diagnosticable {
...
@@ -731,7 +731,7 @@ class Typography with Diagnosticable {
// These defaults are generated from the Material Design Token
// These defaults are generated from the Material Design Token
// database by the script dev/tools/gen_defaults/bin/gen_defaults.dart.
// database by the script dev/tools/gen_defaults/bin/gen_defaults.dart.
// Generated version v0_
76
// Generated version v0_
81
class
_M3Typography
{
class
_M3Typography
{
_M3Typography
.
_
();
_M3Typography
.
_
();
...
...
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