import '../data/local/local_storage_service.dart'; import '../data/nostr/nostr_service.dart'; import '../data/sync/sync_engine.dart'; import '../data/firebase/firebase_service.dart'; import '../data/session/session_service.dart'; import '../data/immich/immich_service.dart'; /// Container for all application services. /// /// Holds references to all initialized services and provides /// a convenient way to dispose of them. class AppServices { /// Local storage service. final LocalStorageService localStorageService; /// Nostr service. final NostrService? nostrService; /// Sync engine. final SyncEngine? syncEngine; /// Firebase service. final FirebaseService? firebaseService; /// Session service. final SessionService? sessionService; /// Immich service. final ImmichService? immichService; /// Creates an [AppServices] instance. AppServices({ required this.localStorageService, this.nostrService, this.syncEngine, this.firebaseService, this.sessionService, this.immichService, }); /// Disposes of all services that need cleanup. Future dispose() async { syncEngine?.dispose(); nostrService?.dispose(); firebaseService?.dispose(); // Close storage service try { await localStorageService.close(); } catch (e) { // Ignore errors during cleanup } } }