app Module
This commit is contained in:
@@ -1,22 +1,32 @@
|
|||||||
package `in`.sminnovations.attendanceapp.screens.login.data
|
package `in`.sminnovations.attendanceapp.di
|
||||||
|
|
||||||
// File: AppModule.kt
|
|
||||||
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
|
import com.google.firebase.firestore.FirebaseFirestore
|
||||||
import dagger.Module
|
import dagger.Module
|
||||||
import dagger.Provides
|
import dagger.Provides
|
||||||
import dagger.hilt.InstallIn
|
import dagger.hilt.InstallIn
|
||||||
import dagger.hilt.android.qualifiers.ApplicationContext
|
import dagger.hilt.android.qualifiers.ApplicationContext
|
||||||
import dagger.hilt.components.SingletonComponent
|
import dagger.hilt.components.SingletonComponent
|
||||||
|
import `in`.sminnovations.attendanceapp.screens.login.data.LoginDataStore
|
||||||
import javax.inject.Singleton
|
import javax.inject.Singleton
|
||||||
|
|
||||||
@Module
|
@Module
|
||||||
@InstallIn(SingletonComponent::class)
|
@InstallIn(SingletonComponent::class)
|
||||||
object AppModule {
|
object AppModule {
|
||||||
|
|
||||||
@Provides
|
@Provides
|
||||||
@Singleton
|
@Singleton
|
||||||
fun provideLoginDataStore(@ApplicationContext context: Context): LoginDataStore {
|
fun provideLoginDataStore(@ApplicationContext context: Context): LoginDataStore {
|
||||||
return LoginDataStore(context)
|
return LoginDataStore(context)
|
||||||
}
|
}
|
||||||
|
@Provides
|
||||||
|
@Singleton
|
||||||
|
fun provideFirebase(): FirebaseFirestore {
|
||||||
|
return FirebaseFirestore.getInstance()
|
||||||
|
}
|
||||||
|
|
||||||
|
// fun provideFirebase(): FirebaseFirestore {
|
||||||
|
// return FirebaseFirestore.getInstance()
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user