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:
@@ -1,4 +1,3 @@
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import '../terminal/terminal_layout.dart';
|
||||
@@ -16,41 +15,25 @@ class SettingsTerminalSection extends StatelessWidget {
|
||||
Widget build(BuildContext context) => ListenableBuilder(
|
||||
listenable: layout,
|
||||
builder: (context, _) {
|
||||
final cupertino = usesCupertinoControls(context);
|
||||
final Widget choice = cupertino
|
||||
? CupertinoSlidingSegmentedControl<TerminalMode>(
|
||||
groupValue: layout.mode,
|
||||
children: {
|
||||
for (final mode in TerminalMode.values)
|
||||
mode: Padding(
|
||||
key: ValueKey('settings-terminal-${mode.name}'),
|
||||
padding: const EdgeInsets.symmetric(horizontal: 8),
|
||||
child: Text(mode.label),
|
||||
),
|
||||
},
|
||||
onValueChanged: (mode) {
|
||||
if (mode != null) layout.setMode(mode);
|
||||
},
|
||||
)
|
||||
: SegmentedButton<TerminalMode>(
|
||||
segments: [
|
||||
for (final mode in TerminalMode.values)
|
||||
ButtonSegment(
|
||||
value: mode,
|
||||
label: Text(
|
||||
mode.label,
|
||||
key: ValueKey('settings-terminal-${mode.name}'),
|
||||
),
|
||||
icon: Icon(
|
||||
mode == TerminalMode.panel
|
||||
? Icons.call_to_action_outlined
|
||||
: Icons.picture_in_picture_alt_outlined,
|
||||
),
|
||||
),
|
||||
],
|
||||
selected: {layout.mode},
|
||||
onSelectionChanged: (modes) => layout.setMode(modes.first),
|
||||
);
|
||||
final Widget choice = SegmentedButton<TerminalMode>(
|
||||
segments: [
|
||||
for (final mode in TerminalMode.values)
|
||||
ButtonSegment(
|
||||
value: mode,
|
||||
label: Text(
|
||||
mode.label,
|
||||
key: ValueKey('settings-terminal-${mode.name}'),
|
||||
),
|
||||
icon: Icon(
|
||||
mode == TerminalMode.panel
|
||||
? Icons.call_to_action_outlined
|
||||
: Icons.picture_in_picture_alt_outlined,
|
||||
),
|
||||
),
|
||||
],
|
||||
selected: {layout.mode},
|
||||
onSelectionChanged: (modes) => layout.setMode(modes.first),
|
||||
);
|
||||
return SettingsGroup(
|
||||
title: 'Terminal',
|
||||
footer: Column(
|
||||
|
||||
Reference in New Issue
Block a user