📄di Directory

di directory represents modules

--di(directory)
     --App Module.kt
     --FirebaseModule.kt
     --NetworkModule.kt
     --RepositoryModule.kt

di/AppModule.kt

package com.matar.app.di

import android.content.Context
import com.matar.app.ui.features.home.HomeViewModel
import com.matar.app.ui.util.PreferenceManager
import dagger.Module
import dagger.Provides
import dagger.hilt.InstallIn
import dagger.hilt.android.qualifiers.ApplicationContext
import dagger.hilt.components.SingletonComponent
import javax.inject.Singleton

@InstallIn(SingletonComponent::class)
@Module
object AppModule {

    @Singleton
    @Provides
    fun providePrefs(@ApplicationContext context: Context) = PreferenceManager(context)

}

di/FirebaseModule.kt

Last updated