package Ġapp . ch int an . natur ist . di Ċ Ċ import Ġandroid . app . Application Ċ import Ġandroid . content . Context Ċ import Ġandroidx . datastore . core . DataStore Ċ import Ġandroidx . datastore . preferences . core . Preferences Ċ import Ġandroidx . datastore . preferences . preferences DataStore Ċ import Ġdagger . Module Ċ import Ġdagger . Provides Ċ import Ġdagger . h ilt . Install In Ċ import Ġdagger . h ilt . components . Singleton Component Ċ import Ġjavax . inject . Singleton Ċ Ċ @ Module Ċ @ Install In ( Singleton Component :: class ) Ċ class ĠPref DataStore Module Ġ{ ĊĊĠĠĠ Ġ@ Provides ĊĠĠĠ Ġ@ Singleton ĊĠĠĠ Ġfun ĠgetData Store ( app : ĠApplication ) Ġ= ĠgetData Store Instance ( app ) Ċ Ċ } Ċ Ċ val ĠContext . data Store : ĠData Store < Preferences > Ġby Ġpreferences DataStore ( name Ġ= Ġ" natur ist DB ") Ċ Ċ fun ĠgetData Store Instance ( android Application : ĠApplication ): ĠData Store < Preferences > Ġ= ĊĠĠĠ Ġandroid Application . data Store ĊĊ