package Ġworld . ach ie ver . pl any our day . di Ċ Ċ import Ġandroid . content . Context Ċ import Ġandroidx . datastore . core . DataStore Ċ import Ġandroidx . datastore . preferences . core . Preference DataStore Factory Ċ import Ġandroidx . datastore . preferences . core . Preferences Ċ import Ġandroidx . datastore . preferences . preferences DataStore File Ċ import Ġandroidx . room . Room Ċ 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 Ċ import Ġkotlinx . coroutines . Dispatch ers Ċ import Ġworld . ach ie ver . pl any our day . data . source . local . Database Dao Ċ import Ġworld . ach ie ver . pl any our day . data . source . local . Plan Database Ċ Ċ private Ġconst Ġval ĠPL AN _ YOUR _ DAY _ PREFER ENCES Ġ= Ġ" plan _ your _ day _ preferences " Ċ Ċ @ Module Ċ @ Install In ( Singleton Component :: class ) Ċ object ĠApp Module Ġ{ ĊĊĠĠĠ Ġ@ Provides ĊĠĠĠ Ġ@ Singleton ĊĠĠĠ Ġfun Ġprovide Database (@ ApplicationContext Ġapp Context : ĠContext ): ĠPlan Database Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn ĠRoom . database Builder ( ĊĠĠĠĠĠĠĠĠĠĠĠ Ġapp Context , ĊĠĠĠĠĠĠĠĠĠĠĠ ĠPlan Database :: class . java , ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ" plan _ your _ day . db " ĊĠĠĠĠĠĠĠ Ġ). build () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Provides ĊĠĠĠ Ġfun Ġprovide Log Dao ( database : ĠPlan Database ): ĠDatabase Dao Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġdatabase . plan Dao () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Provides ĊĠĠĠ Ġ@ Singleton ĊĠĠĠ Ġfun Ġprovide Preferences DataStore (@ ApplicationContext Ġapp Context : ĠContext ): ĠData Store < Preferences > Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn ĠPreference DataStore Factory . create Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġapp Context . preferences DataStore File ( PLAN _ YOUR _ DAY _ PREFER ENCES ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Singleton ĊĠĠĠ Ġ@ Provides ĊĠĠĠ Ġfun Ġprovide Io Dispatcher () Ġ= ĠDispatch ers . IO Ċ }