Unverified Commit d8b7eb6e authored by Darren Austin's avatar Darren Austin Committed by GitHub

Updated token templates to sync with master code. (#117097)

parent aa0b6811
...@@ -72,7 +72,7 @@ class _${blockName}DefaultsM3 extends ChipThemeData { ...@@ -72,7 +72,7 @@ class _${blockName}DefaultsM3 extends ChipThemeData {
EdgeInsetsGeometry? get labelPadding => EdgeInsets.lerp( EdgeInsetsGeometry? get labelPadding => EdgeInsets.lerp(
const EdgeInsets.symmetric(horizontal: 8.0), const EdgeInsets.symmetric(horizontal: 8.0),
const EdgeInsets.symmetric(horizontal: 4.0), const EdgeInsets.symmetric(horizontal: 4.0),
clampDouble(MediaQuery.of(context).textScaleFactor - 1.0, 0.0, 1.0), clampDouble(MediaQuery.textScaleFactorOf(context) - 1.0, 0.0, 1.0),
)!; )!;
} }
'''; ''';
......
...@@ -78,7 +78,7 @@ class _${blockName}DefaultsM3 extends ChipThemeData { ...@@ -78,7 +78,7 @@ class _${blockName}DefaultsM3 extends ChipThemeData {
EdgeInsetsGeometry? get labelPadding => EdgeInsets.lerp( EdgeInsetsGeometry? get labelPadding => EdgeInsets.lerp(
const EdgeInsets.symmetric(horizontal: 8.0), const EdgeInsets.symmetric(horizontal: 8.0),
const EdgeInsets.symmetric(horizontal: 4.0), const EdgeInsets.symmetric(horizontal: 4.0),
clampDouble(MediaQuery.of(context).textScaleFactor - 1.0, 0.0, 1.0), clampDouble(MediaQuery.textScaleFactorOf(context) - 1.0, 0.0, 1.0),
)!; )!;
} }
'''; ''';
......
...@@ -71,7 +71,7 @@ class _${blockName}DefaultsM3 extends ChipThemeData { ...@@ -71,7 +71,7 @@ class _${blockName}DefaultsM3 extends ChipThemeData {
EdgeInsetsGeometry? get labelPadding => EdgeInsets.lerp( EdgeInsetsGeometry? get labelPadding => EdgeInsets.lerp(
const EdgeInsets.symmetric(horizontal: 8.0), const EdgeInsets.symmetric(horizontal: 8.0),
const EdgeInsets.symmetric(horizontal: 4.0), const EdgeInsets.symmetric(horizontal: 4.0),
clampDouble(MediaQuery.of(context).textScaleFactor - 1.0, 0.0, 1.0), clampDouble(MediaQuery.textScaleFactorOf(context) - 1.0, 0.0, 1.0),
)!; )!;
} }
'''; ''';
......
...@@ -18,6 +18,7 @@ class _MenuBarDefaultsM3 extends MenuStyle { ...@@ -18,6 +18,7 @@ class _MenuBarDefaultsM3 extends MenuStyle {
shape: const MaterialStatePropertyAll<OutlinedBorder>(_defaultMenuBorder), shape: const MaterialStatePropertyAll<OutlinedBorder>(_defaultMenuBorder),
alignment: AlignmentDirectional.bottomStart, alignment: AlignmentDirectional.bottomStart,
); );
static const RoundedRectangleBorder _defaultMenuBorder = static const RoundedRectangleBorder _defaultMenuBorder =
${shape('md.comp.menu.container', '')}; ${shape('md.comp.menu.container', '')};
...@@ -60,6 +61,7 @@ class _MenuButtonDefaultsM3 extends ButtonStyle { ...@@ -60,6 +61,7 @@ class _MenuButtonDefaultsM3 extends ButtonStyle {
enableFeedback: true, enableFeedback: true,
alignment: AlignmentDirectional.centerStart, alignment: AlignmentDirectional.centerStart,
); );
final BuildContext context; final BuildContext context;
late final ColorScheme _colors = Theme.of(context).colorScheme; late final ColorScheme _colors = Theme.of(context).colorScheme;
...@@ -190,7 +192,7 @@ class _MenuButtonDefaultsM3 extends ButtonStyle { ...@@ -190,7 +192,7 @@ class _MenuButtonDefaultsM3 extends ButtonStyle {
const EdgeInsets.symmetric(horizontal: 12), const EdgeInsets.symmetric(horizontal: 12),
const EdgeInsets.symmetric(horizontal: 8), const EdgeInsets.symmetric(horizontal: 8),
const EdgeInsets.symmetric(horizontal: 4), const EdgeInsets.symmetric(horizontal: 4),
MediaQuery.maybeOf(context)?.textScaleFactor ?? 1, MediaQuery.maybeTextScaleFactorOf(context) ?? 1,
); );
} }
} }
...@@ -202,6 +204,7 @@ class _MenuDefaultsM3 extends MenuStyle { ...@@ -202,6 +204,7 @@ class _MenuDefaultsM3 extends MenuStyle {
shape: const MaterialStatePropertyAll<OutlinedBorder>(_defaultMenuBorder), shape: const MaterialStatePropertyAll<OutlinedBorder>(_defaultMenuBorder),
alignment: AlignmentDirectional.topEnd, alignment: AlignmentDirectional.topEnd,
); );
static const RoundedRectangleBorder _defaultMenuBorder = static const RoundedRectangleBorder _defaultMenuBorder =
${shape('md.comp.menu.container', '')}; ${shape('md.comp.menu.container', '')};
......
...@@ -306,8 +306,11 @@ class _${blockName}DefaultsM3 extends _TimePickerDefaults { ...@@ -306,8 +306,11 @@ class _${blockName}DefaultsM3 extends _TimePickerDefaults {
InputDecorationTheme get inputDecorationTheme { InputDecorationTheme get inputDecorationTheme {
// This is NOT correct, but there's no token for // This is NOT correct, but there's no token for
// 'time-input.container.shape', so this is using the radius from the shape // 'time-input.container.shape', so this is using the radius from the shape
// for the hour/minute selector. // for the hour/minute selector. It's a BorderRadiusGeometry, so we have to
final BorderRadiusGeometry selectorRadius = ${shape('$hourMinuteComponent.container')}.borderRadius; // resolve it before we can use it.
final BorderRadius selectorRadius = ${shape('$hourMinuteComponent.container')}
.borderRadius
.resolve(Directionality.of(context));
return InputDecorationTheme( return InputDecorationTheme(
contentPadding: EdgeInsets.zero, contentPadding: EdgeInsets.zero,
filled: true, filled: true,
......
...@@ -3684,9 +3684,7 @@ class _TimePickerDefaultsM3 extends _TimePickerDefaults { ...@@ -3684,9 +3684,7 @@ class _TimePickerDefaultsM3 extends _TimePickerDefaults {
// 'time-input.container.shape', so this is using the radius from the shape // 'time-input.container.shape', so this is using the radius from the shape
// for the hour/minute selector. It's a BorderRadiusGeometry, so we have to // for the hour/minute selector. It's a BorderRadiusGeometry, so we have to
// resolve it before we can use it. // resolve it before we can use it.
final BorderRadius selectorRadius = const RoundedRectangleBorder( final BorderRadius selectorRadius = const RoundedRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(8.0)))
borderRadius: BorderRadius.all(Radius.circular(8.0)),
)
.borderRadius .borderRadius
.resolve(Directionality.of(context)); .resolve(Directionality.of(context));
return InputDecorationTheme( return InputDecorationTheme(
......
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