Your commit message here

This commit is contained in:
2025-12-19 22:47:27 -06:00
parent 5d746d694e
commit 464692ce56
21 changed files with 3018 additions and 0 deletions

View File

@@ -1,7 +1,10 @@
import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:google_fonts/google_fonts.dart';
<<<<<<< HEAD
import 'package:hive_flutter/hive_flutter.dart';
=======
>>>>>>> 6742220 (Your commit message here)
import '../../theme/app_theme.dart';
import '../../models/user_profile.dart';
import '../../models/cycle_entry.dart';
@@ -14,6 +17,7 @@ import '../../widgets/cycle_ring.dart';
import '../../widgets/scripture_card.dart';
import '../../widgets/quick_log_buttons.dart';
import '../../providers/user_provider.dart';
<<<<<<< HEAD
import '../../services/cycle_service.dart';
class HomeScreen extends ConsumerStatefulWidget {
@@ -31,28 +35,60 @@ class _HomeScreenState extends ConsumerState<HomeScreen> {
return Scaffold(
body: IndexedStack(
index: _selectedIndex,
=======
import '../../providers/navigation_provider.dart';
import '../../services/cycle_service.dart';
import '../../services/bible_utils.dart';
class HomeScreen extends ConsumerWidget {
const HomeScreen({super.key});
@override
Widget build(BuildContext context, WidgetRef ref) {
final selectedIndex = ref.watch(navigationProvider);
return Scaffold(
body: IndexedStack(
index: selectedIndex,
>>>>>>> 6742220 (Your commit message here)
children: [
const _DashboardTab(),
const CalendarScreen(),
const LogScreen(),
const DevotionalScreen(),
<<<<<<< HEAD
_SettingsTab(onReset: () => setState(() => _selectedIndex = 0)),
=======
_SettingsTab(onReset: () => ref.read(navigationProvider.notifier).setIndex(0)),
>>>>>>> 6742220 (Your commit message here)
],
),
bottomNavigationBar: Container(
decoration: BoxDecoration(
<<<<<<< HEAD
color: Colors.white,
boxShadow: [
BoxShadow(
color: AppColors.charcoal.withOpacity(0.1),
=======
color: Theme.of(context).bottomNavigationBarTheme.backgroundColor,
boxShadow: [
BoxShadow(
color: (Theme.of(context).brightness == Brightness.dark ? Colors.black : AppColors.charcoal).withOpacity(0.1),
>>>>>>> 6742220 (Your commit message here)
blurRadius: 10,
offset: const Offset(0, -2),
),
],
),
child: BottomNavigationBar(
<<<<<<< HEAD
currentIndex: _selectedIndex,
onTap: (index) => setState(() => _selectedIndex = index),
=======
currentIndex: selectedIndex,
onTap: (index) => ref.read(navigationProvider.notifier).setIndex(index),
>>>>>>> 6742220 (Your commit message here)
items: const [
BottomNavigationBarItem(
icon: Icon(Icons.home_outlined),
@@ -91,6 +127,7 @@ class _DashboardTab extends ConsumerWidget {
@override
Widget build(BuildContext context, WidgetRef ref) {
<<<<<<< HEAD
final user = ref.watch(userProfileProvider);
final cycleInfo = ref.watch(currentCycleInfoProvider);
@@ -100,6 +137,18 @@ class _DashboardTab extends ConsumerWidget {
final cycleLength = user?.averageCycleLength ?? 28;
// Get scripture for current phase
=======
final name = ref.watch(userProfileProvider.select((u) => u?.name)) ?? 'Friend';
final translation = ref.watch(userProfileProvider.select((u) => u?.bibleTranslation)) ?? BibleTranslation.esv;
final role = ref.watch(userProfileProvider.select((u) => u?.role)) ?? UserRole.wife;
final isMarried = ref.watch(userProfileProvider.select((u) => u?.isMarried)) ?? false;
final averageCycleLength = ref.watch(userProfileProvider.select((u) => u?.averageCycleLength)) ?? 28;
final cycleInfo = ref.watch(currentCycleInfoProvider);
final phase = cycleInfo['phase'] as CyclePhase;
final dayOfCycle = cycleInfo['dayOfCycle'] as int;
>>>>>>> 6742220 (Your commit message here)
final scripture = ScriptureDatabase.getScriptureForPhase(phase.name);
return SafeArea(
@@ -108,6 +157,7 @@ class _DashboardTab extends ConsumerWidget {
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
<<<<<<< HEAD
// Greeting
_buildGreeting(name),
const SizedBox(height: 24),
@@ -137,15 +187,50 @@ class _DashboardTab extends ConsumerWidget {
fontSize: 18,
fontWeight: FontWeight.w600,
color: AppColors.charcoal,
=======
_buildGreeting(context, name),
const SizedBox(height: 24),
Center(
child: CycleRing(
dayOfCycle: dayOfCycle,
totalDays: averageCycleLength,
phase: phase,
),
),
const SizedBox(height: 32),
ScriptureCard(
verse: scripture.getVerse(translation),
reference: scripture.reference,
translation: translation.label,
phase: phase,
onTranslationTap: () => BibleUtils.showTranslationPicker(context, ref),
),
const SizedBox(height: 24),
Text(
'Quick Log',
style: Theme.of(context).textTheme.titleLarge?.copyWith(
fontSize: 18,
fontWeight: FontWeight.w600,
>>>>>>> 6742220 (Your commit message here)
),
),
const SizedBox(height: 12),
const QuickLogButtons(),
<<<<<<< HEAD
const SizedBox(height: 20),
// Today's Tip - Only show if not just tracking or husband (though husband has own screen)
if (user?.role == UserRole.wife)
TipCard(phase: phase, isMarried: user?.isMarried ?? false),
=======
const SizedBox(height: 24),
if (role == UserRole.wife)
TipCard(phase: phase, isMarried: isMarried),
>>>>>>> 6742220 (Your commit message here)
const SizedBox(height: 20),
],
),
@@ -153,7 +238,12 @@ class _DashboardTab extends ConsumerWidget {
);
}
<<<<<<< HEAD
Widget _buildGreeting(String name) {
=======
Widget _buildGreeting(BuildContext context, String name) {
final theme = Theme.of(context);
>>>>>>> 6742220 (Your commit message here)
final hour = DateTime.now().hour;
String greeting;
if (hour < 12) {
@@ -174,15 +264,26 @@ class _DashboardTab extends ConsumerWidget {
'$greeting,',
style: GoogleFonts.outfit(
fontSize: 16,
<<<<<<< HEAD
color: AppColors.warmGray,
=======
color: theme.colorScheme.onSurfaceVariant,
>>>>>>> 6742220 (Your commit message here)
),
),
Text(
name,
<<<<<<< HEAD
style: GoogleFonts.outfit(
fontSize: 28,
fontWeight: FontWeight.w600,
color: AppColors.charcoal,
=======
style: theme.textTheme.displaySmall?.copyWith(
fontSize: 28,
fontWeight: FontWeight.w600,
color: theme.colorScheme.onSurface,
>>>>>>> 6742220 (Your commit message here)
),
),
],
@@ -192,19 +293,31 @@ class _DashboardTab extends ConsumerWidget {
width: 48,
height: 48,
decoration: BoxDecoration(
<<<<<<< HEAD
color: AppColors.blushPink,
borderRadius: BorderRadius.circular(12),
),
child: const Icon(
Icons.notifications_outlined,
color: AppColors.rose,
=======
color: theme.colorScheme.primaryContainer.withOpacity(0.5),
borderRadius: BorderRadius.circular(12),
),
child: Icon(
Icons.notifications_outlined,
color: theme.colorScheme.primary,
>>>>>>> 6742220 (Your commit message here)
),
),
],
);
}
<<<<<<< HEAD
// Placeholder _calculateCycleInfo removed as it's now in CycleService
=======
>>>>>>> 6742220 (Your commit message here)
}
class _SettingsTab extends ConsumerWidget {
@@ -213,6 +326,7 @@ class _SettingsTab extends ConsumerWidget {
Widget _buildSettingsTile(BuildContext context, IconData icon, String title, {VoidCallback? onTap}) {
return ListTile(
<<<<<<< HEAD
leading: Icon(icon, color: AppColors.charcoal),
title: Text(
title,
@@ -222,6 +336,16 @@ class _SettingsTab extends ConsumerWidget {
),
),
trailing: Icon(Icons.chevron_right, color: AppColors.lightGray),
=======
leading: Icon(icon, color: Theme.of(context).colorScheme.onSurface.withOpacity(0.8)),
title: Text(
title,
style: Theme.of(context).textTheme.bodyLarge?.copyWith(
fontSize: 16,
),
),
trailing: const Icon(Icons.chevron_right, color: AppColors.lightGray),
>>>>>>> 6742220 (Your commit message here)
onTap: onTap ?? () {
ScaffoldMessenger.of(context).showSnackBar(
const SnackBar(content: Text('Settings coming soon!')),
@@ -259,7 +383,14 @@ class _SettingsTab extends ConsumerWidget {
@override
Widget build(BuildContext context, WidgetRef ref) {
<<<<<<< HEAD
final user = ref.watch(userProfileProvider);
=======
final name = ref.watch(userProfileProvider.select((u) => u?.name)) ?? 'Guest';
final roleSymbol = ref.watch(userProfileProvider.select((u) => u?.role)) == UserRole.husband ? 'HUSBAND' : null;
final relationshipStatus = ref.watch(userProfileProvider.select((u) => u?.relationshipStatus.name.toUpperCase())) ?? 'SINGLE';
final translationLabel = ref.watch(userProfileProvider.select((u) => u?.bibleTranslation.label)) ?? 'ESV';
>>>>>>> 6742220 (Your commit message here)
return SafeArea(
child: SingleChildScrollView(
@@ -269,14 +400,22 @@ class _SettingsTab extends ConsumerWidget {
children: [
Text(
'Settings',
<<<<<<< HEAD
style: GoogleFonts.outfit(
fontSize: 28,
fontWeight: FontWeight.w600,
color: AppColors.charcoal,
=======
style: Theme.of(context).textTheme.displayMedium?.copyWith(
fontSize: 28,
fontWeight: FontWeight.w600,
color: Theme.of(context).colorScheme.onSurface,
>>>>>>> 6742220 (Your commit message here)
),
),
const SizedBox(height: 24),
<<<<<<< HEAD
// Profile Card
Container(
padding: const EdgeInsets.all(20),
@@ -290,6 +429,14 @@ class _SettingsTab extends ConsumerWidget {
offset: const Offset(0, 4),
),
],
=======
Container(
padding: const EdgeInsets.all(20),
decoration: BoxDecoration(
color: Theme.of(context).cardTheme.color,
borderRadius: BorderRadius.circular(16),
border: Border.all(color: Theme.of(context).colorScheme.outline.withOpacity(0.05)),
>>>>>>> 6742220 (Your commit message here)
),
child: Row(
children: [
@@ -306,7 +453,11 @@ class _SettingsTab extends ConsumerWidget {
),
child: Center(
child: Text(
<<<<<<< HEAD
user?.name.isNotEmpty == true ? user!.name[0].toUpperCase() : '?',
=======
name.isNotEmpty ? name[0].toUpperCase() : '?',
>>>>>>> 6742220 (Your commit message here)
style: GoogleFonts.outfit(
fontSize: 24,
fontWeight: FontWeight.w600,
@@ -321,6 +472,7 @@ class _SettingsTab extends ConsumerWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
<<<<<<< HEAD
user?.name ?? 'Guest',
style: GoogleFonts.outfit(
fontSize: 18,
@@ -332,6 +484,16 @@ class _SettingsTab extends ConsumerWidget {
user?.role == UserRole.husband
? 'HUSBAND'
: (user?.relationshipStatus.name.toUpperCase() ?? 'SINGLE'),
=======
name,
style: Theme.of(context).textTheme.titleLarge?.copyWith(
fontSize: 18,
fontWeight: FontWeight.w600,
),
),
Text(
roleSymbol ?? relationshipStatus,
>>>>>>> 6742220 (Your commit message here)
style: GoogleFonts.outfit(
fontSize: 12,
letterSpacing: 1,
@@ -341,27 +503,50 @@ class _SettingsTab extends ConsumerWidget {
],
),
),
<<<<<<< HEAD
Icon(Icons.chevron_right, color: AppColors.warmGray),
=======
const Icon(Icons.chevron_right, color: AppColors.warmGray),
>>>>>>> 6742220 (Your commit message here)
],
),
),
const SizedBox(height: 24),
<<<<<<< HEAD
// Settings Groups
_buildSettingsGroup('Preferences', [
_buildSettingsTile(context, Icons.notifications_outlined, 'Notifications'),
=======
_buildSettingsGroup(context, 'Preferences', [
_buildSettingsTile(context, Icons.notifications_outlined, 'Notifications'),
_buildSettingsTile(
context,
Icons.book_outlined,
'Bible Version ($translationLabel)',
onTap: () => BibleUtils.showTranslationPicker(context, ref),
),
>>>>>>> 6742220 (Your commit message here)
_buildSettingsTile(context, Icons.palette_outlined, 'Appearance'),
_buildSettingsTile(context, Icons.lock_outline, 'Privacy'),
]),
const SizedBox(height: 16),
<<<<<<< HEAD
_buildSettingsGroup('Cycle', [
=======
_buildSettingsGroup(context, 'Cycle', [
>>>>>>> 6742220 (Your commit message here)
_buildSettingsTile(context, Icons.calendar_today_outlined, 'Cycle Settings'),
_buildSettingsTile(context, Icons.trending_up_outlined, 'Cycle History'),
_buildSettingsTile(context, Icons.download_outlined, 'Export Data'),
]),
const SizedBox(height: 16),
<<<<<<< HEAD
_buildSettingsGroup('Account', [
=======
_buildSettingsGroup(context, 'Account', [
>>>>>>> 6742220 (Your commit message here)
_buildSettingsTile(
context,
Icons.logout,
@@ -376,7 +561,11 @@ class _SettingsTab extends ConsumerWidget {
);
}
<<<<<<< HEAD
Widget _buildSettingsGroup(String title, List<Widget> tiles) {
=======
Widget _buildSettingsGroup(BuildContext context, String title, List<Widget> tiles) {
>>>>>>> 6742220 (Your commit message here)
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
@@ -392,8 +581,14 @@ class _SettingsTab extends ConsumerWidget {
const SizedBox(height: 8),
Container(
decoration: BoxDecoration(
<<<<<<< HEAD
color: Colors.white,
borderRadius: BorderRadius.circular(12),
=======
color: Theme.of(context).cardTheme.color,
borderRadius: BorderRadius.circular(12),
border: Border.all(color: Theme.of(context).colorScheme.outline.withOpacity(0.05)),
>>>>>>> 6742220 (Your commit message here)
),
child: Column(
children: tiles,
@@ -403,4 +598,7 @@ class _SettingsTab extends ConsumerWidget {
);
}
}
<<<<<<< HEAD
=======
>>>>>>> 6742220 (Your commit message here)