This commit is contained in:
2025-12-30 23:20:50 -06:00
parent 9f8eab4a31
commit ec923c906e
26 changed files with 2234 additions and 53 deletions

View File

@@ -0,0 +1,87 @@
import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import '../../models/user_profile.dart';
import '../../providers/user_provider.dart';
class SharingSettingsScreen extends ConsumerWidget {
const SharingSettingsScreen({super.key});
@override
Widget build(BuildContext context, WidgetRef ref) {
final userProfile = ref.watch(userProfileProvider);
if (userProfile == null) {
return Scaffold(
appBar: AppBar(
title: const Text('Sharing Settings'),
),
body: const Center(child: CircularProgressIndicator()),
);
}
return Scaffold(
appBar: AppBar(
title: const Text('Sharing Settings'),
),
body: ListView(
padding: const EdgeInsets.all(16.0),
children: [
SwitchListTile(
title: const Text('Share Moods'),
value: userProfile.shareMoods,
onChanged: (value) {
ref
.read(userProfileProvider.notifier)
.updateProfile(userProfile.copyWith(shareMoods: value));
},
),
SwitchListTile(
title: const Text('Share Symptoms'),
value: userProfile.shareSymptoms,
onChanged: (value) {
ref
.read(userProfileProvider.notifier)
.updateProfile(userProfile.copyWith(shareSymptoms: value));
},
),
SwitchListTile(
title: const Text('Share Cravings'),
value: userProfile.shareCravings,
onChanged: (value) {
ref
.read(userProfileProvider.notifier)
.updateProfile(userProfile.copyWith(shareCravings: value));
},
),
SwitchListTile(
title: const Text('Share Energy Levels'),
value: userProfile.shareEnergyLevels,
onChanged: (value) {
ref
.read(userProfileProvider.notifier)
.updateProfile(userProfile.copyWith(shareEnergyLevels: value));
},
),
SwitchListTile(
title: const Text('Share Sleep Data'),
value: userProfile.shareSleep,
onChanged: (value) {
ref
.read(userProfileProvider.notifier)
.updateProfile(userProfile.copyWith(shareSleep: value));
},
),
SwitchListTile(
title: const Text('Share Intimacy Details'),
value: userProfile.shareIntimacy,
onChanged: (value) {
ref
.read(userProfileProvider.notifier)
.updateProfile(userProfile.copyWith(shareIntimacy: value));
},
),
],
),
);
}
}