fix(app): use native schedule text roles instead of fixed sizes and weights

This commit is contained in:
2026-10-21 22:06:39 +01:00
parent 6a0f1c345e
commit ff9d3ce4a8
3 changed files with 10 additions and 17 deletions
@@ -6,8 +6,8 @@ import '../../../../ui/adaptive/host.dart';
/// Secondary text under a field, using the host's own colours and text theme. /// Secondary text under a field, using the host's own colours and text theme.
TextStyle scheduleEditorSecondaryStyle(BuildContext context) { TextStyle scheduleEditorSecondaryStyle(BuildContext context) {
if (usesCupertinoHost(context)) { if (usesCupertinoHost(context)) {
return CupertinoTheme.of(context).textTheme.textStyle.copyWith( // The host's own secondary-label style; no invented point size.
fontSize: 14, return CupertinoTheme.of(context).textTheme.tabLabelTextStyle.copyWith(
color: CupertinoColors.secondaryLabel.resolveFrom(context), color: CupertinoColors.secondaryLabel.resolveFrom(context),
); );
} }
@@ -80,28 +80,22 @@ class ScheduleListRow extends StatelessWidget {
Text(value, style: _metaStyle(context)); Text(value, style: _metaStyle(context));
TextStyle? _titleStyle(BuildContext context) => cupertino TextStyle? _titleStyle(BuildContext context) => cupertino
? CupertinoTheme.of( ? CupertinoTheme.of(context).textTheme.navTitleTextStyle
context, : Theme.of(context).textTheme.titleMedium;
).textTheme.textStyle.copyWith(fontWeight: FontWeight.w600)
: Theme.of(
context,
).textTheme.titleMedium?.copyWith(fontWeight: FontWeight.w600);
TextStyle? _bodyStyle(BuildContext context) => TextStyle? _bodyStyle(BuildContext context) =>
cupertino ? CupertinoTheme.of(context).textTheme.textStyle : null; cupertino ? CupertinoTheme.of(context).textTheme.textStyle : null;
TextStyle? _metaStyle(BuildContext context) => cupertino TextStyle? _metaStyle(BuildContext context) => cupertino
? CupertinoTheme.of(context).textTheme.textStyle.copyWith( ? CupertinoTheme.of(
fontSize: 14, context,
color: _secondaryColor(context), ).textTheme.tabLabelTextStyle.copyWith(color: _secondaryColor(context))
)
: Theme.of( : Theme.of(
context, context,
).textTheme.bodySmall?.copyWith(color: _secondaryColor(context)); ).textTheme.bodySmall?.copyWith(color: _secondaryColor(context));
TextStyle? _statusStyle(BuildContext context) => _metaStyle( TextStyle? _statusStyle(BuildContext context) =>
context, _metaStyle(context)?.copyWith(color: _statusColor(context));
)?.copyWith(color: _statusColor(context), fontWeight: FontWeight.w600);
Color _secondaryColor(BuildContext context) => cupertino Color _secondaryColor(BuildContext context) => cupertino
? CupertinoColors.secondaryLabel.resolveFrom(context) ? CupertinoColors.secondaryLabel.resolveFrom(context)
@@ -169,8 +169,7 @@ class ScheduleListToolbar extends StatelessWidget {
} }
TextStyle? _metaStyle(BuildContext context) => cupertino TextStyle? _metaStyle(BuildContext context) => cupertino
? CupertinoTheme.of(context).textTheme.textStyle.copyWith( ? CupertinoTheme.of(context).textTheme.tabLabelTextStyle.copyWith(
fontSize: 14,
color: CupertinoColors.secondaryLabel.resolveFrom(context), color: CupertinoColors.secondaryLabel.resolveFrom(context),
) )
: Theme.of(context).textTheme.bodySmall?.copyWith( : Theme.of(context).textTheme.bodySmall?.copyWith(