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, ); }