Remove Cupertino settings branches

Keep the Material settings implementation while preserving public Cupertino parameters for later cleanup. Narrow settings tests to the Material-only behavior.
This commit is contained in:
2026-11-11 05:21:30 +00:00
parent 75fd194394
commit 3933ff980c
18 changed files with 191 additions and 503 deletions
+3 -21
View File
@@ -1,33 +1,15 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import '../../ui/adaptive/host.dart';
Color settingsErrorColor(BuildContext context) =>
Theme.of(context).colorScheme.error;
/// Cupertino only under an explicit Cupertino host; Material on every
/// platform otherwise.
bool usesCupertinoControls(BuildContext context) => usesCupertinoHost(context);
Color settingsErrorColor(BuildContext context) => usesCupertinoControls(context)
? CupertinoColors.destructiveRed.resolveFrom(context)
: Theme.of(context).colorScheme.error;
/// Resolve native text roles from the actual host, not Material's fallback
/// light theme when mounted under a dark CupertinoApp.
/// Resolve the app's text roles from the Material theme.
TextStyle settingsTextStyle(
BuildContext context, {
bool title = false,
bool secondary = false,
bool error = false,
}) {
if (usesCupertinoControls(context)) {
final text = CupertinoTheme.of(context).textTheme;
return (title ? text.navTitleTextStyle : text.textStyle).copyWith(
color: error
? settingsErrorColor(context)
: (secondary ? CupertinoColors.secondaryLabel : CupertinoColors.label)
.resolveFrom(context),
);
}
final theme = Theme.of(context);
final base = (title
? theme.textTheme.titleMedium