feat(settings): 添加通知偏好设置和后端 API 集成

This commit is contained in:
qzl
2026-04-07 18:43:42 +08:00
parent b18a205bf3
commit b22673ce49
9 changed files with 612 additions and 29 deletions
@@ -119,6 +119,64 @@ class SettingsMenuTile extends StatelessWidget {
}
}
class SettingsSwitchTile extends StatelessWidget {
const SettingsSwitchTile({
super.key,
required this.icon,
required this.title,
required this.value,
required this.onChanged,
required this.tint,
required this.background,
this.showDivider = true,
});
final IconData icon;
final String title;
final bool value;
final ValueChanged<bool> onChanged;
final Color tint;
final Color background;
final bool showDivider;
@override
Widget build(BuildContext context) {
final colors = Theme.of(context).colorScheme;
return Column(
children: [
ListTile(
contentPadding: const EdgeInsets.symmetric(
horizontal: AppSpacing.lg,
vertical: AppSpacing.sm,
),
leading: Container(
width: 40,
height: 40,
decoration: BoxDecoration(
color: background,
borderRadius: BorderRadius.circular(AppRadius.md),
),
child: Icon(icon, color: tint),
),
title: Text(title),
trailing: Switch(
value: value,
onChanged: onChanged,
activeColor: colors.primary,
),
),
if (showDivider)
Divider(
height: 1,
indent: 72,
endIndent: AppSpacing.lg,
color: colors.outline,
),
],
);
}
}
class ProfileHeaderCard extends StatelessWidget {
const ProfileHeaderCard({
super.key,