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,5 +1,4 @@
|
||||
import 'dart:async';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import '../../ui/motion/quick_switch_animation.dart';
|
||||
import 'settings_theme.dart';
|
||||
@@ -9,28 +8,6 @@ class SettingsQuickSwitchControl extends StatelessWidget {
|
||||
const SettingsQuickSwitchControl({super.key, required this.controller});
|
||||
final QuickSwitchAnimationController controller;
|
||||
|
||||
Future<void> _choose(BuildContext context) async {
|
||||
final choice = await showCupertinoModalPopup<QuickSwitchAnimation>(
|
||||
context: context,
|
||||
builder: (context) => CupertinoActionSheet(
|
||||
title: const Text('Quick switch animation'),
|
||||
actions: [
|
||||
for (final animation in QuickSwitchAnimation.values)
|
||||
CupertinoActionSheetAction(
|
||||
isDefaultAction: animation == controller.value,
|
||||
onPressed: () => Navigator.pop(context, animation),
|
||||
child: Text(animation.label),
|
||||
),
|
||||
],
|
||||
cancelButton: CupertinoActionSheetAction(
|
||||
onPressed: () => Navigator.pop(context),
|
||||
child: const Text('Cancel'),
|
||||
),
|
||||
),
|
||||
);
|
||||
if (choice != null) await controller.setAnimation(choice);
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) => ListenableBuilder(
|
||||
listenable: controller,
|
||||
@@ -41,33 +18,17 @@ class SettingsQuickSwitchControl extends StatelessWidget {
|
||||
'Quick switch animation',
|
||||
style: settingsTextStyle(context, title: true),
|
||||
),
|
||||
if (usesCupertinoControls(context))
|
||||
CupertinoButton(
|
||||
onPressed: () => unawaited(_choose(context)),
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Text(controller.value.label),
|
||||
const SizedBox(width: 8),
|
||||
const Icon(CupertinoIcons.chevron_down),
|
||||
],
|
||||
),
|
||||
)
|
||||
else
|
||||
DropdownButton<QuickSwitchAnimation>(
|
||||
value: controller.value,
|
||||
isExpanded: true,
|
||||
items: [
|
||||
for (final animation in QuickSwitchAnimation.values)
|
||||
DropdownMenuItem(
|
||||
value: animation,
|
||||
child: Text(animation.label),
|
||||
),
|
||||
],
|
||||
onChanged: (value) {
|
||||
if (value != null) unawaited(controller.setAnimation(value));
|
||||
},
|
||||
),
|
||||
DropdownButton<QuickSwitchAnimation>(
|
||||
value: controller.value,
|
||||
isExpanded: true,
|
||||
items: [
|
||||
for (final animation in QuickSwitchAnimation.values)
|
||||
DropdownMenuItem(value: animation, child: Text(animation.label)),
|
||||
],
|
||||
onChanged: (value) {
|
||||
if (value != null) unawaited(controller.setAnimation(value));
|
||||
},
|
||||
),
|
||||
Text(controller.value.description),
|
||||
const SizedBox(height: 8),
|
||||
QuickSwitchPreview(animation: controller.value),
|
||||
|
||||
Reference in New Issue
Block a user