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:
@@ -6,122 +6,45 @@ import '../models/cycle_entry.dart';
|
||||
class ScriptureCard extends StatelessWidget {
|
||||
final String verse;
|
||||
final String reference;
|
||||
<<<<<<< HEAD
|
||||
final CyclePhase phase;
|
||||
=======
|
||||
final String? translation;
|
||||
final CyclePhase phase;
|
||||
final VoidCallback? onTranslationTap;
|
||||
>>>>>>> 6742220 (Your commit message here)
|
||||
|
||||
const ScriptureCard({
|
||||
super.key,
|
||||
required this.verse,
|
||||
required this.reference,
|
||||
<<<<<<< HEAD
|
||||
required this.phase,
|
||||
=======
|
||||
this.translation,
|
||||
required this.phase,
|
||||
this.onTranslationTap,
|
||||
>>>>>>> 6742220 (Your commit message here)
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
<<<<<<< HEAD
|
||||
return Container(
|
||||
width: double.infinity,
|
||||
padding: const EdgeInsets.all(20),
|
||||
decoration: BoxDecoration(
|
||||
gradient: LinearGradient(
|
||||
colors: _getGradientColors(phase),
|
||||
=======
|
||||
final theme = Theme.of(context);
|
||||
final isDark = theme.brightness == Brightness.dark;
|
||||
|
||||
|
||||
return Container(
|
||||
width: double.infinity,
|
||||
decoration: BoxDecoration(
|
||||
gradient: LinearGradient(
|
||||
colors: _getGradientColors(context, phase),
|
||||
>>>>>>> 6742220 (Your commit message here)
|
||||
begin: Alignment.topLeft,
|
||||
end: Alignment.bottomRight,
|
||||
),
|
||||
borderRadius: BorderRadius.circular(20),
|
||||
<<<<<<< HEAD
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: _getPhaseColor(phase).withOpacity(0.2),
|
||||
=======
|
||||
border: Border.all(color: isDark ? Colors.white.withOpacity(0.05) : Colors.black.withOpacity(0.05)),
|
||||
border: Border.all(
|
||||
color: isDark
|
||||
? Colors.white.withOpacity(0.05)
|
||||
: Colors.black.withOpacity(0.05)),
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: _getPhaseColor(phase).withOpacity(isDark ? 0.05 : 0.15),
|
||||
>>>>>>> 6742220 (Your commit message here)
|
||||
blurRadius: 15,
|
||||
offset: const Offset(0, 8),
|
||||
),
|
||||
],
|
||||
),
|
||||
<<<<<<< HEAD
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
// Scripture icon
|
||||
Row(
|
||||
children: [
|
||||
Container(
|
||||
width: 32,
|
||||
height: 32,
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white.withOpacity(0.3),
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
child: Icon(
|
||||
Icons.menu_book_outlined,
|
||||
size: 18,
|
||||
color: AppColors.charcoal.withOpacity(0.8),
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 8),
|
||||
Text(
|
||||
'Today\'s Verse',
|
||||
style: GoogleFonts.outfit(
|
||||
fontSize: 12,
|
||||
fontWeight: FontWeight.w500,
|
||||
color: AppColors.charcoal.withOpacity(0.7),
|
||||
letterSpacing: 0.5,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
|
||||
// Verse
|
||||
Text(
|
||||
'"$verse"',
|
||||
style: GoogleFonts.lora(
|
||||
fontSize: 16,
|
||||
fontStyle: FontStyle.italic,
|
||||
color: AppColors.charcoal,
|
||||
height: 1.6,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
|
||||
// Reference
|
||||
Text(
|
||||
'— $reference',
|
||||
style: GoogleFonts.outfit(
|
||||
fontSize: 13,
|
||||
fontWeight: FontWeight.w500,
|
||||
color: AppColors.warmGray,
|
||||
),
|
||||
),
|
||||
],
|
||||
=======
|
||||
child: Material(
|
||||
color: Colors.transparent,
|
||||
child: Padding(
|
||||
@@ -136,13 +59,16 @@ class ScriptureCard extends StatelessWidget {
|
||||
width: 32,
|
||||
height: 32,
|
||||
decoration: BoxDecoration(
|
||||
color: (isDark ? Colors.white : Colors.black).withOpacity(0.1),
|
||||
color: (isDark ? Colors.white : Colors.black)
|
||||
.withOpacity(0.1),
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
child: Icon(
|
||||
Icons.menu_book_outlined,
|
||||
size: 18,
|
||||
color: isDark ? Colors.white70 : AppColors.charcoal.withOpacity(0.8),
|
||||
color: isDark
|
||||
? Colors.white70
|
||||
: AppColors.charcoal.withOpacity(0.8),
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 8),
|
||||
@@ -150,40 +76,46 @@ class ScriptureCard extends StatelessWidget {
|
||||
'Today\'s Verse',
|
||||
style: theme.textTheme.labelLarge?.copyWith(
|
||||
fontSize: 12,
|
||||
color: isDark ? Colors.white60 : AppColors.charcoal.withOpacity(0.7),
|
||||
color: isDark
|
||||
? Colors.white60
|
||||
: AppColors.charcoal.withOpacity(0.7),
|
||||
letterSpacing: 0.5,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
|
||||
|
||||
// Verse
|
||||
Text(
|
||||
'"$verse"',
|
||||
style: scriptureStyle(context, fontSize: 17),
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
|
||||
|
||||
// Reference & Translation
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
'— $reference',
|
||||
style: scriptureRefStyle(context).copyWith(fontSize: 13, fontWeight: FontWeight.w600),
|
||||
style: scriptureRefStyle(context)
|
||||
.copyWith(fontSize: 13, fontWeight: FontWeight.w600),
|
||||
),
|
||||
if (translation != null)
|
||||
InkWell(
|
||||
onTap: onTranslationTap,
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
child: Container(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 6),
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 10, vertical: 6),
|
||||
decoration: BoxDecoration(
|
||||
color: (isDark ? Colors.white : Colors.black).withOpacity(0.05),
|
||||
color: (isDark ? Colors.white : Colors.black)
|
||||
.withOpacity(0.05),
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
border: Border.all(
|
||||
color: (isDark ? Colors.white : Colors.black).withOpacity(0.1),
|
||||
color: (isDark ? Colors.white : Colors.black)
|
||||
.withOpacity(0.1),
|
||||
),
|
||||
),
|
||||
child: Row(
|
||||
@@ -199,9 +131,11 @@ class ScriptureCard extends StatelessWidget {
|
||||
),
|
||||
const SizedBox(width: 4),
|
||||
Icon(
|
||||
Icons.swap_horiz,
|
||||
size: 14,
|
||||
color: isDark ? Colors.white38 : AppColors.warmGray,
|
||||
Icons.swap_horiz,
|
||||
size: 14,
|
||||
color: isDark
|
||||
? Colors.white38
|
||||
: AppColors.warmGray,
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -212,38 +146,14 @@ class ScriptureCard extends StatelessWidget {
|
||||
],
|
||||
),
|
||||
),
|
||||
>>>>>>> 6742220 (Your commit message here)
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
<<<<<<< HEAD
|
||||
List<Color> _getGradientColors(CyclePhase phase) {
|
||||
switch (phase) {
|
||||
case CyclePhase.menstrual:
|
||||
return [
|
||||
AppColors.blushPink.withOpacity(0.6),
|
||||
AppColors.cream,
|
||||
];
|
||||
case CyclePhase.follicular:
|
||||
return [
|
||||
AppColors.sageGreen.withOpacity(0.3),
|
||||
AppColors.cream,
|
||||
];
|
||||
case CyclePhase.ovulation:
|
||||
return [
|
||||
AppColors.lavender.withOpacity(0.5),
|
||||
AppColors.cream,
|
||||
];
|
||||
case CyclePhase.luteal:
|
||||
return [
|
||||
AppColors.lutealPhase.withOpacity(0.3),
|
||||
AppColors.cream,
|
||||
=======
|
||||
List<Color> _getGradientColors(BuildContext context, CyclePhase phase) {
|
||||
final isDark = Theme.of(context).brightness == Brightness.dark;
|
||||
final baseColor = isDark ? const Color(0xFF1E1E1E) : AppColors.cream;
|
||||
|
||||
|
||||
switch (phase) {
|
||||
case CyclePhase.menstrual:
|
||||
return [
|
||||
@@ -264,7 +174,6 @@ class ScriptureCard extends StatelessWidget {
|
||||
return [
|
||||
AppColors.lutealPhase.withOpacity(isDark ? 0.15 : 0.3),
|
||||
baseColor,
|
||||
>>>>>>> 6742220 (Your commit message here)
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user