Initial commit: Fixes for linting and compilation
This commit is contained in:
49
lib/main.dart
Normal file
49
lib/main.dart
Normal file
@@ -0,0 +1,49 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:hive_flutter/hive_flutter.dart';
|
||||
import 'package:google_fonts/google_fonts.dart';
|
||||
|
||||
import 'theme/app_theme.dart';
|
||||
import 'screens/splash_screen.dart';
|
||||
import 'models/user_profile.dart';
|
||||
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());
|
||||
Hive.registerAdapter(RelationshipStatusAdapter());
|
||||
Hive.registerAdapter(FertilityGoalAdapter());
|
||||
Hive.registerAdapter(MoodLevelAdapter());
|
||||
Hive.registerAdapter(FlowIntensityAdapter());
|
||||
Hive.registerAdapter(CervicalMucusTypeAdapter());
|
||||
Hive.registerAdapter(CyclePhaseAdapter());
|
||||
Hive.registerAdapter(UserRoleAdapter());
|
||||
|
||||
// Open boxes
|
||||
await Hive.openBox<UserProfile>('user_profile');
|
||||
await Hive.openBox<CycleEntry>('cycle_entries');
|
||||
|
||||
runApp(const ProviderScope(child: ChristianPeriodTrackerApp()));
|
||||
}
|
||||
|
||||
class ChristianPeriodTrackerApp extends StatelessWidget {
|
||||
const ChristianPeriodTrackerApp({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return MaterialApp(
|
||||
title: 'Christian Period Tracker',
|
||||
debugShowCheckedModeBanner: false,
|
||||
theme: AppTheme.lightTheme,
|
||||
darkTheme: AppTheme.darkTheme,
|
||||
themeMode: ThemeMode.system,
|
||||
home: const SplashScreen(),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user