mirror of
https://github.com/flutter/flutter
synced 2024-08-28 04:21:14 +00:00
Updated token templates to sync with master code. (#117097)
This commit is contained in:
parent
aa0b68119f
commit
d8b7eb6e29
|
@ -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 {
|
||||||
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 {
|
||||||
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 {
|
||||||
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 {
|
||||||
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 {
|
||||||
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 {
|
||||||
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 {
|
||||||
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 {
|
||||||
// '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(
|
||||||
|
|
Loading…
Reference in a new issue