feat: Add auto-sync, fix partner linking UI, update sharing settings

- Add 10-second periodic auto-sync to CycleEntriesNotifier
- Fix husband_devotional_screen: use partnerId for isConnected check, navigate to SharingSettingsScreen instead of legacy mock dialog
- Remove obsolete _showConnectDialog method and mock data import
- Update husband_settings_screen: show 'Partner Settings' with linked partner name when connected
- Add SharingSettingsScreen: Pad Supplies toggle (disabled when pad tracking off), Intimacy always enabled
- Add CORS OPTIONS handler to backend server
- Add _ensureServerRegistration for reliable partner linking
- Add copy button to Invite Partner dialog
- Dynamic base URL for web (uses window.location.hostname)
This commit is contained in:
2026-01-09 17:20:49 -06:00
parent d28898cb81
commit 1c2c56e9e2
21 changed files with 1690 additions and 493 deletions

View File

@@ -3,6 +3,8 @@ import 'package:flutter/material.dart';
import 'package:hive_flutter/hive_flutter.dart';
import 'main.dart'; // Import ChristianPeriodTrackerApp
import 'models/cycle_entry.dart';
import 'models/teaching_plan.dart';
import 'models/prayer_request.dart';
import 'models/scripture.dart';
import 'models/user_profile.dart';
import 'screens/splash_screen.dart';
@@ -40,11 +42,17 @@ class _AppStartupWidgetState extends State<AppStartupWidget> {
try {
setState(() => _status = 'Loading user profile...');
// Add timeout to prevent indefinite hanging
await Hive.openBox<UserProfile>('user_profile')
await Hive.openBox<UserProfile>('user_profile_v2')
.timeout(const Duration(seconds: 5));
setState(() => _status = 'Loading cycle data...');
await Hive.openBox<CycleEntry>('cycle_entries')
await Hive.openBox<CycleEntry>('cycle_entries_v2')
.timeout(const Duration(seconds: 5));
setState(() => _status = 'Loading shared data...');
await Hive.openBox<TeachingPlan>('teaching_plans_v2')
.timeout(const Duration(seconds: 5));
await Hive.openBox<PrayerRequest>('prayer_requests_v2')
.timeout(const Duration(seconds: 5));
setState(() => _status = 'Loading scriptures...');