Add selectionClick to settings switches, discrete slider steps, bottom nav tabs, and expandable section headers. Fix intensity levels for cache clear and random color (medium → light). Add lightImpact to thumbnail long-press. Fix inconsistent search result long-press level. Replace blanket lightImpact in updateNotification with targeted haptics at error/warning call sites to eliminate double-firing and match severity. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
33 lines
774 B
Dart
33 lines
774 B
Dart
import 'package:flutter/material.dart';
|
|
import 'package:flutter/services.dart';
|
|
|
|
/// A custom-styled adaptive [SwitchListTile].
|
|
class SettingsListSwitch extends StatelessWidget {
|
|
final String title;
|
|
final Widget? subtitle;
|
|
final bool value;
|
|
final ValueChanged<bool>? onChanged;
|
|
|
|
const SettingsListSwitch({
|
|
super.key,
|
|
required this.title,
|
|
this.subtitle,
|
|
this.onChanged,
|
|
required this.value,
|
|
});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return SwitchListTile.adaptive(
|
|
title: Text(title),
|
|
subtitle: subtitle,
|
|
value: value,
|
|
onChanged: onChanged != null
|
|
? (newValue) {
|
|
HapticFeedback.selectionClick();
|
|
onChanged!(newValue);
|
|
}
|
|
: null,
|
|
);
|
|
}
|
|
}
|