improved push notification settings with health indicators and optimized notification dismissal

This commit is contained in:
2026-07-16 22:40:33 +02:00
parent 8128cede21
commit e625216a90
5 changed files with 223 additions and 49 deletions
@@ -14,29 +14,39 @@ class SettingsCheckboxTile extends StatelessWidget {
final bool value;
final ValueChanged<bool> onChanged;
/// Optional widget rendered just before the checkbox (e.g. a status icon).
final Widget? beforeCheckbox;
const SettingsCheckboxTile({
required this.icon,
required this.title,
required this.value,
required this.onChanged,
this.subtitle,
this.beforeCheckbox,
super.key,
});
@override
Widget build(BuildContext context) {
final leadingIcon = Icon(icon);
final checkbox = Checkbox(
value: value,
onChanged: (e) {
Haptics.selection();
onChanged(e ?? false);
},
);
return ListTile(
leading: subtitle == null ? leadingIcon : CenteredLeading(leadingIcon),
title: Text(title),
subtitle: subtitle == null ? null : Text(subtitle!),
trailing: Checkbox(
value: value,
onChanged: (e) {
Haptics.selection();
onChanged(e ?? false);
},
),
trailing: beforeCheckbox == null
? checkbox
: Row(
mainAxisSize: MainAxisSize.min,
children: [beforeCheckbox!, checkbox],
),
);
}
}