Remove Cupertino changes branches
Keep the Material-only changes feature while preserving public Cupertino parameters for callers. Remove Cupertino-only widgets, imports, hosts, and tests because the app never reaches that path.
This commit is contained in:
@@ -1,8 +1,6 @@
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import '../domain/unified_patch.dart';
|
||||
import 'diff_form_control.dart';
|
||||
|
||||
export 'diff_form_control.dart';
|
||||
|
||||
@@ -10,12 +8,6 @@ export 'diff_form_control.dart';
|
||||
TextStyle nativeDiffText(TextStyle base) =>
|
||||
base.copyWith(fontFamily: 'RobotoMono');
|
||||
|
||||
/// Keep Material-derived metadata roles readable inside a Cupertino host.
|
||||
ThemeData hostTextTheme(BuildContext context) => ThemeData(
|
||||
brightness: CupertinoTheme.brightnessOf(context),
|
||||
platform: Theme.of(context).platform,
|
||||
);
|
||||
|
||||
/// GitHub's diff palette (Primer): each changed line on a green or red tint,
|
||||
/// its +/- marker and the +N/-N counts in the strong green or red. The code
|
||||
/// itself keeps the label colour, as on GitHub, and the exact recorded
|
||||
@@ -45,10 +37,7 @@ ThemeData hostTextTheme(BuildContext context) => ThemeData(
|
||||
}
|
||||
|
||||
bool _isDark(BuildContext context) =>
|
||||
(usesCupertino(context)
|
||||
? CupertinoTheme.brightnessOf(context)
|
||||
: Theme.of(context).brightness) ==
|
||||
Brightness.dark;
|
||||
Theme.of(context).brightness == Brightness.dark;
|
||||
|
||||
/// Added lines and counts: GitHub's addition green.
|
||||
Color addedColor(BuildContext context) =>
|
||||
@@ -94,17 +83,14 @@ class ChangeStatText extends StatelessWidget {
|
||||
}
|
||||
}
|
||||
|
||||
Color labelColor(BuildContext context) => usesCupertino(context)
|
||||
? CupertinoColors.label.resolveFrom(context)
|
||||
: Theme.of(context).colorScheme.onSurface;
|
||||
Color labelColor(BuildContext context) =>
|
||||
Theme.of(context).colorScheme.onSurface;
|
||||
|
||||
Color mutedColor(BuildContext context) => usesCupertino(context)
|
||||
? CupertinoColors.secondaryLabel.resolveFrom(context)
|
||||
: Theme.of(context).colorScheme.onSurfaceVariant;
|
||||
Color mutedColor(BuildContext context) =>
|
||||
Theme.of(context).colorScheme.onSurfaceVariant;
|
||||
|
||||
Color hunkHeaderColor(BuildContext context) => usesCupertino(context)
|
||||
? CupertinoColors.tertiarySystemFill.resolveFrom(context)
|
||||
: Theme.of(context).colorScheme.surfaceContainerHighest;
|
||||
Color hunkHeaderColor(BuildContext context) =>
|
||||
Theme.of(context).colorScheme.surfaceContainerHighest;
|
||||
|
||||
Widget copyPatchControl(
|
||||
BuildContext context, {
|
||||
@@ -113,21 +99,6 @@ Widget copyPatchControl(
|
||||
required VoidCallback onPressed,
|
||||
}) {
|
||||
final label = copied ? 'Copied' : 'Copy patch';
|
||||
if (usesCupertino(context)) {
|
||||
return CupertinoButton(
|
||||
padding: EdgeInsets.zero,
|
||||
minimumSize: const Size(44, 44),
|
||||
onPressed: enabled ? onPressed : null,
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
const Icon(CupertinoIcons.doc_on_doc, size: 30),
|
||||
const SizedBox(width: 8),
|
||||
Text(label),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
return TextButton.icon(
|
||||
style: TextButton.styleFrom(minimumSize: const Size(0, 48)),
|
||||
onPressed: enabled ? onPressed : null,
|
||||
@@ -137,20 +108,6 @@ Widget copyPatchControl(
|
||||
}
|
||||
|
||||
Widget closeDiffControl(BuildContext context, VoidCallback onClose) {
|
||||
if (usesCupertino(context)) {
|
||||
return Semantics(
|
||||
label: 'Close diff',
|
||||
button: true,
|
||||
excludeSemantics: true,
|
||||
onTap: onClose,
|
||||
child: CupertinoButton(
|
||||
padding: EdgeInsets.zero,
|
||||
minimumSize: const Size(44, 44),
|
||||
onPressed: onClose,
|
||||
child: const Icon(CupertinoIcons.xmark, size: 30),
|
||||
),
|
||||
);
|
||||
}
|
||||
return IconButton(
|
||||
constraints: const BoxConstraints(minWidth: 48, minHeight: 48),
|
||||
padding: EdgeInsets.zero,
|
||||
|
||||
Reference in New Issue
Block a user