Files
pipelines/app/lib/features/settings/settings_quick_switch_control.dart
alan 3933ff980c 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.
2026-11-11 05:21:30 +00:00

44 lines
1.4 KiB
Dart

import 'dart:async';
import 'package:flutter/material.dart';
import '../../ui/motion/quick_switch_animation.dart';
import 'settings_theme.dart';
import 'quick_switch_preview.dart';
class SettingsQuickSwitchControl extends StatelessWidget {
const SettingsQuickSwitchControl({super.key, required this.controller});
final QuickSwitchAnimationController controller;
@override
Widget build(BuildContext context) => ListenableBuilder(
listenable: controller,
builder: (context, _) => Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
Text(
'Quick switch animation',
style: settingsTextStyle(context, title: true),
),
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),
if (controller.saveFailed)
Text(
'Could not save; applies until reload.',
style: TextStyle(color: settingsErrorColor(context)),
),
],
),
);
}