refactor: perform clean up

This commit is contained in:
Patryk Hegenberg 2026-02-18 23:08:44 +01:00
parent e57da88272
commit 6b70116a63
5 changed files with 48 additions and 20 deletions

View file

@ -23,23 +23,30 @@ void main() async {
DeviceOrientation.portraitDown,
]);
final notificationService = NotificationService();
await notificationService.init();
final database = AppDatabase();
final authStore = PbAuthStore();
await authStore.loadFromStorage();
final container = ProviderContainer(
overrides: [
appDatabaseProvider.overrideWithValue(database),
apiClientProvider
.overrideWith((ref) => ApiClient(authStore: authStore)),
],
);
try {
log('Initializing NotificationService...');
container.read(notificationServiceProvider).init();
} catch (e) {
log('Error triggering NotificationService: $e');
}
log("Auth loaded. Valid? ${authStore.isValid}");
runApp(
ProviderScope(
overrides: [
appDatabaseProvider.overrideWithValue(database),
apiClientProvider
.overrideWith((ref) => ApiClient(authStore: authStore)),
],
UncontrolledProviderScope(
container: container,
child: const SLRPGApp(),
),
);