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:
@@ -3,6 +3,7 @@ import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:hive_flutter/hive_flutter.dart';
|
||||
import 'package:google_fonts/google_fonts.dart';
|
||||
|
||||
import 'models/scripture.dart';
|
||||
import 'theme/app_theme.dart';
|
||||
import 'screens/splash_screen.dart';
|
||||
import 'models/user_profile.dart';
|
||||
@@ -10,10 +11,10 @@ import 'models/cycle_entry.dart';
|
||||
|
||||
void main() async {
|
||||
WidgetsFlutterBinding.ensureInitialized();
|
||||
|
||||
|
||||
// Initialize Hive for local storage
|
||||
await Hive.initFlutter();
|
||||
|
||||
|
||||
// Register Hive adapters
|
||||
Hive.registerAdapter(UserProfileAdapter());
|
||||
Hive.registerAdapter(CycleEntryAdapter());
|
||||
@@ -24,15 +25,16 @@ void main() async {
|
||||
Hive.registerAdapter(CervicalMucusTypeAdapter());
|
||||
Hive.registerAdapter(CyclePhaseAdapter());
|
||||
Hive.registerAdapter(UserRoleAdapter());
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
Hive.registerAdapter(BibleTranslationAdapter());
|
||||
>>>>>>> 6742220 (Your commit message here)
|
||||
|
||||
// Open boxes
|
||||
await Hive.openBox<UserProfile>('user_profile');
|
||||
await Hive.openBox<CycleEntry>('cycle_entries');
|
||||
|
||||
Hive.registerAdapter(ScriptureAdapter()); // Register Scripture adapter
|
||||
|
||||
// Open boxes and load scriptures in parallel
|
||||
await Future.wait([
|
||||
Hive.openBox<UserProfile>('user_profile'),
|
||||
Hive.openBox<CycleEntry>('cycle_entries'),
|
||||
ScriptureDatabase().loadScriptures(),
|
||||
]);
|
||||
|
||||
runApp(const ProviderScope(child: ChristianPeriodTrackerApp()));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user