feat: Implement husband features and fix iOS Safari web startup
Implement initial features for husband's companion app, including mock data service and husband notes screen. Refactor scripture and cycle services for improved stability and testability. Address iOS Safari web app startup issue by removing deprecated initialization. - Implemented MockDataService and HusbandNotesScreen. - Converted _DashboardTab and DevotionalScreen to StatefulWidgets for robust scripture provider initialization. - Refactored CycleService to use immutable CycleInfo class, reducing UI rebuilds. - Removed deprecated window.flutterConfiguration from index.html, resolving Flutter web app startup failure on iOS Safari. - Updated and fixed related tests.
This commit is contained in:
@@ -15,31 +15,22 @@ class TipCard extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
final theme = Theme.of(context);
|
||||
final isDark = theme.brightness == Brightness.dark;
|
||||
>>>>>>> 6742220 (Your commit message here)
|
||||
final tip = _getTipForPhase(phase, isMarried);
|
||||
|
||||
return Container(
|
||||
width: double.infinity,
|
||||
padding: const EdgeInsets.all(16),
|
||||
decoration: BoxDecoration(
|
||||
<<<<<<< HEAD
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.circular(16),
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: AppColors.charcoal.withOpacity(0.05),
|
||||
=======
|
||||
color: theme.cardColor,
|
||||
borderRadius: BorderRadius.circular(16),
|
||||
border: isDark ? Border.all(color: Colors.white.withOpacity(0.05)) : null,
|
||||
border:
|
||||
isDark ? Border.all(color: Colors.white.withOpacity(0.05)) : null,
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: (isDark ? Colors.black : AppColors.charcoal).withOpacity(0.05),
|
||||
>>>>>>> 6742220 (Your commit message here)
|
||||
color: (isDark ? Colors.black : AppColors.charcoal)
|
||||
.withOpacity(0.05),
|
||||
blurRadius: 10,
|
||||
offset: const Offset(0, 4),
|
||||
),
|
||||
@@ -52,11 +43,7 @@ class TipCard extends StatelessWidget {
|
||||
width: 40,
|
||||
height: 40,
|
||||
decoration: BoxDecoration(
|
||||
<<<<<<< HEAD
|
||||
color: AppColors.sageGreen.withOpacity(0.15),
|
||||
=======
|
||||
color: AppColors.sageGreen.withOpacity(isDark ? 0.2 : 0.15),
|
||||
>>>>>>> 6742220 (Your commit message here)
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
),
|
||||
child: const Icon(
|
||||
@@ -72,29 +59,14 @@ class TipCard extends StatelessWidget {
|
||||
children: [
|
||||
Text(
|
||||
'Today\'s Tip',
|
||||
<<<<<<< HEAD
|
||||
style: GoogleFonts.outfit(
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w600,
|
||||
color: AppColors.charcoal,
|
||||
=======
|
||||
style: theme.textTheme.titleMedium?.copyWith(
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w600,
|
||||
>>>>>>> 6742220 (Your commit message here)
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 4),
|
||||
Text(
|
||||
tip,
|
||||
<<<<<<< HEAD
|
||||
style: GoogleFonts.outfit(
|
||||
fontSize: 13,
|
||||
color: AppColors.warmGray,
|
||||
height: 1.4,
|
||||
),
|
||||
),
|
||||
=======
|
||||
style: theme.textTheme.bodyMedium?.copyWith(
|
||||
fontSize: 13,
|
||||
height: 1.4,
|
||||
@@ -122,7 +94,6 @@ class TipCard extends StatelessWidget {
|
||||
],
|
||||
),
|
||||
),
|
||||
>>>>>>> 6742220 (Your commit message here)
|
||||
],
|
||||
),
|
||||
),
|
||||
@@ -131,21 +102,6 @@ class TipCard extends StatelessWidget {
|
||||
);
|
||||
}
|
||||
|
||||
<<<<<<< HEAD
|
||||
String _getTipForPhase(CyclePhase phase, bool isMarried) {
|
||||
switch (phase) {
|
||||
case CyclePhase.menstrual:
|
||||
return 'This is a time for rest. Honor your body with extra sleep, warm drinks, and gentle movement. God designed your body with wisdom.';
|
||||
case CyclePhase.follicular:
|
||||
return 'Your energy is rising! This is a great time to start new projects, exercise more intensely, and spend time in community.';
|
||||
case CyclePhase.ovulation:
|
||||
if (isMarried) {
|
||||
return 'This is your most fertile window. You may feel more social and energetic. Prioritize connection with your spouse.';
|
||||
}
|
||||
return 'You may feel more social and confident during this phase. It\'s a great time for important conversations and presentations.';
|
||||
case CyclePhase.luteal:
|
||||
return 'As you enter the luteal phase, focus on nourishing foods, adequate sleep, and stress management. Be gentle with yourself.';
|
||||
=======
|
||||
void _showDetailedInsights(BuildContext context) {
|
||||
final details = _getDetailsForPhase(phase);
|
||||
showDialog(
|
||||
@@ -170,9 +126,11 @@ class TipCard extends StatelessWidget {
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
_buildDetailSection('Nutrition', details['nutrition']!, Icons.restaurant),
|
||||
_buildDetailSection(
|
||||
'Nutrition', details['nutrition']!, Icons.restaurant),
|
||||
const SizedBox(height: 16),
|
||||
_buildDetailSection('Movement', details['movement']!, Icons.fitness_center),
|
||||
_buildDetailSection(
|
||||
'Movement', details['movement']!, Icons.fitness_center),
|
||||
const SizedBox(height: 16),
|
||||
Text(
|
||||
'Note: While these are general trends, your body is unique. Always listen to your own energy levels.',
|
||||
@@ -187,7 +145,8 @@ class TipCard extends StatelessWidget {
|
||||
actions: [
|
||||
TextButton(
|
||||
onPressed: () => Navigator.pop(context),
|
||||
child: Text('Got it', style: GoogleFonts.outfit(color: AppColors.sageGreen)),
|
||||
child: Text('Got it',
|
||||
style: GoogleFonts.outfit(color: AppColors.sageGreen)),
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -243,25 +202,32 @@ class TipCard extends StatelessWidget {
|
||||
switch (phase) {
|
||||
case CyclePhase.menstrual:
|
||||
return {
|
||||
'nutrition': 'Incorporate leafy greens, red meat or lentils for iron. Pair with citrus for better absorption.',
|
||||
'movement': 'Gentle walking, restorative yoga, or just deep breathing. Avoid high-intensity stress.',
|
||||
'nutrition':
|
||||
'Incorporate leafy greens, red meat or lentils for iron. Pair with citrus for better absorption.',
|
||||
'movement':
|
||||
'Gentle walking, restorative yoga, or just deep breathing. Avoid high-intensity stress.',
|
||||
};
|
||||
case CyclePhase.follicular:
|
||||
return {
|
||||
'nutrition': 'Broccoli, cauliflower, and fermented foods help balance rising estrogen. Focus on lean proteins.',
|
||||
'movement': 'Strength training and steady cardio. Your body is primed for building and renewal.',
|
||||
'nutrition':
|
||||
'Broccoli, cauliflower, and fermented foods help balance rising estrogen. Focus on lean proteins.',
|
||||
'movement':
|
||||
'Strength training and steady cardio. Your body is primed for building and renewal.',
|
||||
};
|
||||
case CyclePhase.ovulation:
|
||||
return {
|
||||
'nutrition': 'Avocados, nuts, and seeds provide healthy fats for peak hormonal health. Keep hydration high.',
|
||||
'movement': 'Highest intensity workouts, HIIT, or group sports. You have peak stamina and strength right now.',
|
||||
'nutrition':
|
||||
'Avocados, nuts, and seeds provide healthy fats for peak hormonal health. Keep hydration high.',
|
||||
'movement':
|
||||
'Highest intensity workouts, HIIT, or group sports. You have peak stamina and strength right now.',
|
||||
};
|
||||
case CyclePhase.luteal:
|
||||
return {
|
||||
'nutrition': 'Dark chocolate (70%+), pumpkin seeds, and bananas for magnesium to help with cramps.',
|
||||
'movement': 'Pilates, steady-state swimming, or hiking. Focus on persistence rather than peak intensity.',
|
||||
'nutrition':
|
||||
'Dark chocolate (70%+), pumpkin seeds, and bananas for magnesium to help with cramps.',
|
||||
'movement':
|
||||
'Pilates, steady-state swimming, or hiking. Focus on persistence rather than peak intensity.',
|
||||
};
|
||||
>>>>>>> 6742220 (Your commit message here)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user