refactor: perform clean up
This commit is contained in:
parent
e57da88272
commit
6b70116a63
5 changed files with 48 additions and 20 deletions
|
|
@ -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(),
|
||||
),
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue