3933ff980c
Keep the Material settings implementation while preserving public Cupertino parameters for later cleanup. Narrow settings tests to the Material-only behavior.
25 lines
621 B
Dart
25 lines
621 B
Dart
import 'package:flutter/material.dart';
|
|
|
|
Color settingsErrorColor(BuildContext context) =>
|
|
Theme.of(context).colorScheme.error;
|
|
|
|
/// Resolve the app's text roles from the Material theme.
|
|
TextStyle settingsTextStyle(
|
|
BuildContext context, {
|
|
bool title = false,
|
|
bool secondary = false,
|
|
bool error = false,
|
|
}) {
|
|
final theme = Theme.of(context);
|
|
final base = (title
|
|
? theme.textTheme.titleMedium
|
|
: theme.textTheme.bodyMedium)!;
|
|
return base.copyWith(
|
|
color: error
|
|
? theme.colorScheme.error
|
|
: secondary
|
|
? theme.colorScheme.onSurfaceVariant
|
|
: base.color,
|
|
);
|
|
}
|