Implement husband-wife connection dialogue and theme support for learn articles

This commit is contained in:
2026-01-05 17:09:15 -06:00
parent 02d25d0cc7
commit 96655f9a74
36 changed files with 3849 additions and 819 deletions

View File

@@ -43,22 +43,49 @@ class ExportDataScreen extends ConsumerWidget {
},
),
ListTile(
leading: const Icon(Icons.calendar_month),
title: const Text('Export to Calendar File (.ics)'),
subtitle: const Text('Generate a calendar file for your cycle dates.'),
leading: const Icon(Icons.sync),
title: const Text('Sync with Calendar'),
subtitle: const Text('Export to Apple, Google, or Outlook Calendar.'),
trailing: const Icon(Icons.chevron_right),
onTap: () async {
// Show options dialog
final includePredictions = await showDialog<bool>(
context: context,
builder: (context) => AlertDialog(
title: const Text('Calendar Sync Options'),
content: const Text('Would you like to include predicted future periods for the next 12 months?'),
actions: [
TextButton(
onPressed: () => Navigator.pop(context, false),
child: const Text('No, only history'),
),
TextButton(
onPressed: () => Navigator.pop(context, true),
child: const Text('Yes, include predictions'),
),
],
),
);
if (includePredictions == null) return; // User cancelled dialog (though I didn't add cancel button, tapping outside returns null)
try {
ScaffoldMessenger.of(context).showSnackBar(
const SnackBar(content: Text('Generating ICS file...')),
const SnackBar(content: Text('Generating calendar file...')),
);
await IcsService.generateCycleCalendar(cycleEntries);
await IcsService.generateCycleCalendar(
cycleEntries,
user: userProfile,
includePredictions: includePredictions
);
ScaffoldMessenger.of(context).showSnackBar(
const SnackBar(content: Text('ICS file generated successfully!')),
const SnackBar(content: Text('Calendar file generated! Open it to add to your calendar.')),
);
} catch (e) {
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(content: Text('Failed to generate ICS file: $e')),
SnackBar(content: Text('Failed to generate calendar file: $e')),
);
}
},