import 'package:core/utils/file_utils.dart'; import 'package:core/utils/platform_info.dart'; import 'package:flutter_secure_storage/flutter_secure_storage.dart'; import 'package:get/get.dart'; import 'package:shared_preferences/shared_preferences.dart'; import 'package:tmail_ui_user/features/caching/caching_manager.dart'; import 'package:tmail_ui_user/features/caching/clients/account_cache_client.dart'; import 'package:tmail_ui_user/features/caching/clients/authentication_info_cache_client.dart'; import 'package:tmail_ui_user/features/caching/clients/email_cache_client.dart'; import 'package:tmail_ui_user/features/caching/clients/encryption_key_cache_client.dart'; import 'package:tmail_ui_user/features/caching/clients/fcm_cache_client.dart'; import 'package:tmail_ui_user/features/caching/clients/firebase_registration_cache_client.dart'; import 'package:tmail_ui_user/features/caching/clients/hive_cache_version_client.dart'; import 'package:tmail_ui_user/features/caching/clients/mailbox_cache_client.dart'; import 'package:tmail_ui_user/features/caching/clients/new_email_hive_cache_client.dart'; import 'package:tmail_ui_user/features/caching/clients/oidc_configuration_cache_client.dart'; import 'package:tmail_ui_user/features/caching/clients/opened_email_hive_cache_client.dart'; import 'package:tmail_ui_user/features/caching/clients/recent_login_url_cache_client.dart'; import 'package:tmail_ui_user/features/caching/clients/recent_login_username_cache_client.dart'; import 'package:tmail_ui_user/features/caching/clients/recent_search_cache_client.dart'; import 'package:tmail_ui_user/features/caching/clients/sending_email_hive_cache_client.dart'; import 'package:tmail_ui_user/features/caching/clients/sentry_configuration_cache_client.dart'; import 'package:tmail_ui_user/features/caching/clients/sentry_user_cache_client.dart'; import 'package:tmail_ui_user/features/caching/clients/session_hive_cache_client.dart'; import 'package:tmail_ui_user/features/caching/clients/state_cache_client.dart'; import 'package:tmail_ui_user/features/caching/clients/token_oidc_cache_client.dart'; import 'package:tmail_ui_user/features/caching/manager/sentry_configuration_cache_manager.dart'; import 'package:tmail_ui_user/features/caching/manager/session_cache_manger.dart'; import 'package:tmail_ui_user/features/cleanup/data/local/recent_login_url_cache_manager.dart'; import 'package:tmail_ui_user/features/cleanup/data/local/recent_login_username_cache_manager.dart'; import 'package:tmail_ui_user/features/cleanup/data/local/recent_search_cache_manager.dart'; import 'package:tmail_ui_user/features/login/data/local/account_cache_manager.dart'; import 'package:tmail_ui_user/features/login/data/local/authentication_info_cache_manager.dart'; import 'package:tmail_ui_user/features/login/data/local/encryption_key_cache_manager.dart'; import 'package:tmail_ui_user/features/login/data/local/oidc_configuration_cache_manager.dart'; import 'package:tmail_ui_user/features/login/data/local/token_oidc_cache_manager.dart'; import 'package:tmail_ui_user/features/mailbox/data/local/mailbox_cache_manager.dart'; import 'package:tmail_ui_user/features/mailbox/data/local/state_cache_manager.dart'; import 'package:tmail_ui_user/features/mailbox_creator/domain/usecases/verify_name_interactor.dart'; import 'package:tmail_ui_user/features/mailbox_dashboard/data/local/local_sort_order_manager.dart'; import 'package:tmail_ui_user/features/manage_account/data/local/language_cache_manager.dart'; import 'package:tmail_ui_user/features/manage_account/data/local/preferences_setting_manager.dart'; import 'package:tmail_ui_user/features/offline_mode/manager/new_email_cache_manager.dart'; import 'package:tmail_ui_user/features/offline_mode/manager/new_email_cache_worker_queue.dart'; import 'package:tmail_ui_user/features/offline_mode/manager/opened_email_cache_manager.dart'; import 'package:tmail_ui_user/features/offline_mode/manager/opened_email_cache_worker_queue.dart'; import 'package:tmail_ui_user/features/offline_mode/manager/sending_email_cache_manager.dart'; import 'package:tmail_ui_user/features/push_notification/data/keychain/keychain_sharing_manager.dart'; import 'package:tmail_ui_user/features/push_notification/data/local/fcm_cache_manager.dart'; import 'package:tmail_ui_user/features/thread/data/local/email_cache_manager.dart'; import 'package:tmail_ui_user/main/exceptions/thrower/cache_exception_thrower.dart'; class LocalBindings extends Bindings { @override void dependencies() { _bindingException(); _bindingKeychainSharing(); _bindingCaching(); _bindingWorkerQueue(); _bindingVerifyLogicInteractor(); } void _bindingCaching() { _bindingMailDataCache(); _bindingAccountCache(); _bindingRecentDataCache(); _bindingFcmCache(); _bindingOfflineCache(); if (PlatformInfo.isMobile) _bindingSentryCache(); _bindingCachingManager(); } void _bindingMailDataCache() { Get.put(MailboxCacheClient()); Get.put(MailboxCacheManager(Get.find())); Get.put(StateCacheClient()); Get.put(StateCacheManager(Get.find())); Get.put(EmailCacheClient()); Get.put(EmailCacheManager(Get.find())); Get.put(HiveCacheVersionClient(Get.find(), Get.find())); Get.put(LocalSortOrderManager(Get.find())); } void _bindingAccountCache() { Get.put(TokenOidcCacheClient()); Get.put(TokenOidcCacheManager(Get.find())); Get.put(AccountCacheClient()); Get.put(AccountCacheManager(Get.find())); Get.put(EncryptionKeyCacheClient()); Get.put(EncryptionKeyCacheManager(Get.find())); Get.put(AuthenticationInfoCacheClient()); Get.put(AuthenticationInfoCacheManager(Get.find())); Get.put(OidcConfigurationCacheClient()); Get.put(OidcConfigurationCacheManager(Get.find(), Get.find())); Get.put(LanguageCacheManager(Get.find())); Get.put(PreferencesSettingManager(Get.find())); } void _bindingRecentDataCache() { Get.put(RecentSearchCacheClient()); Get.put(RecentSearchCacheManager(Get.find())); Get.put(RecentLoginUrlCacheClient()); Get.put(RecentLoginUrlCacheManager(Get.find())); Get.put(RecentLoginUsernameCacheClient()); Get.put(RecentLoginUsernameCacheManager(Get.find())); } void _bindingFcmCache() { Get.put(FirebaseRegistrationCacheClient()); Get.put(FcmCacheClient()); Get.put(FCMCacheManager(Get.find(), Get.find())); } void _bindingOfflineCache() { Get.put(NewEmailHiveCacheClient()); Get.put(NewEmailCacheManager(Get.find(), Get.find())); Get.put(OpenedEmailHiveCacheClient()); Get.put(OpenedEmailCacheManager(Get.find(), Get.find())); Get.put(SendingEmailHiveCacheClient()); Get.put(SendingEmailCacheManager(Get.find())); Get.put(SessionHiveCacheClient()); Get.put(SessionCacheManager(Get.find())); } void _bindingSentryCache() { Get.put(SentryConfigurationCacheClient()); Get.put(SentryUserCacheClient()); Get.put(SentryConfigurationCacheManager( Get.find(), Get.find(), )); } void _bindingCachingManager() { Get.put(CachingManager( Get.find(), Get.find(), Get.find(), Get.find(), Get.find(), Get.find(), Get.find(), Get.find(), Get.find(), Get.find(), Get.find(), Get.find(), Get.find(), Get.find(), Get.find(), Get.find(), Get.find(), Get.find(), Get.find(), sentryConfigurationCacheManager: PlatformInfo.isMobile ? Get.find() : null, )); } void _bindingException() { Get.put(CacheExceptionThrower()); } void _bindingWorkerQueue() { Get.put(NewEmailCacheWorkerQueue()); Get.put(OpenedEmailCacheWorkerQueue()); } void _bindingKeychainSharing() { Get.put(KeychainSharingManager(Get.find())); } void _bindingVerifyLogicInteractor() { Get.put(VerifyNameInteractor()); } }