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

@@ -8,6 +8,8 @@ import '../../models/scripture.dart';
import '../calendar/calendar_screen.dart';
import '../log/log_screen.dart';
import '../devotional/devotional_screen.dart';
import '../settings/appearance_screen.dart';
import '../settings/cycle_settings_screen.dart';
import '../../widgets/tip_card.dart';
import '../../widgets/cycle_ring.dart';
import '../../widgets/scripture_card.dart';
@@ -203,7 +205,7 @@ class _DashboardTabState extends ConsumerState<_DashboardTab> {
icon: const Icon(Icons.shuffle),
label: const Text('Random Verse'),
style: TextButton.styleFrom(
foregroundColor: AppColors.sageGreen,
foregroundColor: Theme.of(context).colorScheme.primary,
),
),
),
@@ -219,7 +221,7 @@ class _DashboardTabState extends ConsumerState<_DashboardTab> {
const QuickLogButtons(),
const SizedBox(height: 24),
if (role == UserRole.wife)
TipCard(phase: phase, isMarried: isMarried),
_buildWifeTipsSection(context),
const SizedBox(height: 20),
],
),
@@ -383,8 +385,8 @@ class _SettingsTab extends ConsumerWidget {
decoration: BoxDecoration(
gradient: LinearGradient(
colors: [
AppColors.blushPink,
AppColors.rose.withOpacity(0.7)
Theme.of(context).colorScheme.primary.withOpacity(0.7),
Theme.of(context).colorScheme.secondary.withOpacity(0.7)
],
begin: Alignment.topLeft,
end: Alignment.bottomRight,
@@ -440,7 +442,13 @@ class _SettingsTab extends ConsumerWidget {
'Bible Version ($translationLabel)',
onTap: () => BibleUtils.showTranslationPicker(context, ref),
),
_buildSettingsTile(context, Icons.palette_outlined, 'Appearance'),
_buildSettingsTile(context, Icons.palette_outlined, 'Appearance',
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => const AppearanceScreen()));
}),
_buildSettingsTile(
context,
Icons.favorite_border,
@@ -452,15 +460,32 @@ class _SettingsTab extends ConsumerWidget {
context,
Icons.share_outlined,
'Share with Husband',
onTap: () => _showShareDialog(context, ref),
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => const SharingSettingsScreen()));
},
),
]),
const SizedBox(height: 16),
_buildSettingsGroup(context, 'Cycle', [
_buildSettingsTile(
context, Icons.calendar_today_outlined, 'Cycle Settings'),
context, Icons.calendar_today_outlined, 'Cycle Settings',
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => const CycleSettingsScreen()));
}),
_buildSettingsTile(
context, Icons.trending_up_outlined, 'Cycle History'),
context, Icons.trending_up_outlined, 'Cycle History',
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => const CycleHistoryScreen()));
}),
_buildSettingsTile(
context, Icons.download_outlined, 'Export Data'),
]),
@@ -549,7 +574,7 @@ class _SettingsTab extends ConsumerWidget {
.map((e) => e.trim())
.where((e) => e.isNotEmpty)
.toList();
final updatedProfile = userProfile.copyWith(favoriteFoods: favorites);
ref.read(userProfileProvider.notifier).updateProfile(updatedProfile);
Navigator.pop(context);
@@ -571,7 +596,7 @@ class _SettingsTab extends ConsumerWidget {
builder: (context) => AlertDialog(
title: Row(
children: [
const Icon(Icons.share_outlined, color: AppColors.sageGreen),
Icon(Icons.share_outlined, color: Theme.of(context).colorScheme.primary),
const SizedBox(width: 8),
const Text('Share with Husband'),
],
@@ -587,9 +612,9 @@ class _SettingsTab extends ConsumerWidget {
Container(
padding: const EdgeInsets.symmetric(horizontal: 24, vertical: 16),
decoration: BoxDecoration(
color: AppColors.sageGreen.withOpacity(0.1),
color: Theme.of(context).colorScheme.primary.withOpacity(0.1),
borderRadius: BorderRadius.circular(12),
border: Border.all(color: AppColors.sageGreen.withOpacity(0.3)),
border: Border.all(color: Theme.of(context).colorScheme.primary.withOpacity(0.3)),
),
child: SelectableText(
pairingCode,
@@ -597,7 +622,7 @@ class _SettingsTab extends ConsumerWidget {
fontSize: 32,
fontWeight: FontWeight.bold,
letterSpacing: 4,
color: AppColors.sageGreen,
color: Theme.of(context).colorScheme.primary,
),
),
),
@@ -613,7 +638,7 @@ class _SettingsTab extends ConsumerWidget {
ElevatedButton(
onPressed: () => Navigator.pop(context),
style: ElevatedButton.styleFrom(
backgroundColor: AppColors.sageGreen,
backgroundColor: Theme.of(context).colorScheme.primary,
foregroundColor: Colors.white,
),
child: const Text('Done'),
@@ -623,3 +648,54 @@ class _SettingsTab extends ConsumerWidget {
);
}
}
Widget _buildWifeTipsSection(BuildContext context) {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
'Health Tips',
style: Theme.of(context).textTheme.titleLarge?.copyWith(
fontSize: 18,
fontWeight: FontWeight.w600,
),
),
const SizedBox(height: 12),
Card(
elevation: 2,
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(12)),
child: Padding(
padding: const EdgeInsets.all(16.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
_buildTipCard(
context,
title: 'Regular Check-ups',
content:
'Schedule regular gynecological check-ups to monitor your reproductive health.',
icon: Icons.medical_services,
),
const SizedBox(height: 16),
_buildTipCard(
context,
title: 'Healthy Lifestyle',
content:
'Maintain a balanced diet, exercise regularly, and get adequate sleep.',
icon: Icons.healing,
),
const SizedBox(height: 16),
_buildTipCard(
context,
title: 'Partner Communication',
content:
'Discuss health concerns openly with your partner to ensure mutual understanding.',
icon: Icons.chat,
),
],
),
),
),
],
);
}