优化
This commit is contained in:
@@ -2,9 +2,8 @@ import 'package:flutter/material.dart';
|
||||
import 'package:flutter_localizations/flutter_localizations.dart';
|
||||
import 'l10n/app_localizations.dart';
|
||||
import 'theme/app_theme.dart';
|
||||
import 'services/storage_service.dart';
|
||||
import 'services/di.dart';
|
||||
import 'services/encouragement_service.dart';
|
||||
import 'services/notification_service.dart';
|
||||
import 'screens/home_screen.dart';
|
||||
import 'screens/onboarding_screen.dart';
|
||||
import 'screens/settings_screen.dart';
|
||||
@@ -12,19 +11,10 @@ import 'screens/settings_screen.dart';
|
||||
void main() async {
|
||||
WidgetsFlutterBinding.ensureInitialized();
|
||||
|
||||
// Initialize services
|
||||
await StorageService.init();
|
||||
// Initialize dependency injection
|
||||
await initializeDI();
|
||||
|
||||
final encouragementService = EncouragementService();
|
||||
await encouragementService.loadMessages();
|
||||
|
||||
// Initialize notification service
|
||||
final notificationService = NotificationService();
|
||||
await notificationService.initialize();
|
||||
// Request permissions on first launch
|
||||
await notificationService.requestPermissions();
|
||||
|
||||
runApp(MyApp(encouragementService: encouragementService));
|
||||
runApp(MyApp(encouragementService: getIt<EncouragementService>()));
|
||||
}
|
||||
|
||||
class MyApp extends StatefulWidget {
|
||||
|
||||
Reference in New Issue
Block a user