package Ġcom . aid ar aly . lets chat . di Ċ Ċ import Ġandroid . content . Context Ċ import Ġandroidx . room . Room Ċ import Ġcom . aid ar aly . lets chat . db . Chat User Database Ċ import Ġcom . aid ar aly . lets chat . utils . Constants . CHAT _ USER _ DB _ NAME Ċ import Ġdagger . Module Ċ import Ġdagger . Provides Ċ import Ġdagger . h ilt . Install In Ċ import Ġdagger . h ilt . android . qual ifiers . ApplicationContext Ċ import Ġdagger . h ilt . components . Singleton Component Ċ import Ġjavax . inject . Singleton Ċ Ċ @ Module Ċ @ Install In ( Singleton Component :: class ) Ċ object ĠDb Module Ġ{ ĊĊĠĠĠ Ġ@ Singleton ĊĠĠĠ Ġ@ Provides ĊĠĠĠ Ġfun Ġprovide Chat User Db (@ ApplicationContext Ġcontext : ĠContext ): ĠChat User Database { ĊĠĠĠĠĠĠ Ġreturn ĠRoom . database Builder ( context , Chat User Database :: class . java , ĊĠĠĠĠĠĠĠĠĠĠĠ ĠCH AT _ USER _ DB _ NAME ). build () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Singleton ĊĠĠĠ Ġ@ Provides ĊĠĠĠ Ġfun Ġprovide Chat User Dao ( db : ĠChat User Database ) Ġ= Ġdb . get Chat User Dao () ĊĊĠĠĠ Ġ@ Singleton ĊĠĠĠ Ġ@ Provides ĊĠĠĠ Ġfun Ġprovide Message Dao ( db : ĠChat User Database ) Ġ= Ġdb . getMessage Dao () ĊĊĠĠĠ Ġ@ Singleton ĊĠĠĠ Ġ@ Provides ĊĠĠĠ Ġfun Ġprovide Group Dao ( db : ĠChat User Database ) Ġ= Ġdb . getGroup Dao () ĊĊĠĠĠ Ġ@ Singleton ĊĠĠĠ Ġ@ Provides ĊĠĠĠ Ġfun Ġprovide Group Message Dao ( db : ĠChat User Database ) Ġ= Ġdb . getGroup Message Dao () Ċ }