Skip to content

Instantly share code, notes, and snippets.

@srikrishnasakunia
Created December 29, 2022 10:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save srikrishnasakunia/865afa46dc42101d9b62faf99301519a to your computer and use it in GitHub Desktop.
Save srikrishnasakunia/865afa46dc42101d9b62faf99301519a to your computer and use it in GitHub Desktop.
This file consists of variables that will store the values.
package com.example.datastoretest.data.local
import androidx.datastore.preferences.core.booleanPreferencesKey
import androidx.datastore.preferences.core.intPreferencesKey
import androidx.datastore.preferences.core.longPreferencesKey
import androidx.datastore.preferences.core.stringPreferencesKey
object PreferenceDataStoreConstants {
val IS_MINOR_KEY = booleanPreferencesKey("IS_MINOR_KEY")
val AGE_KEY = intPreferencesKey("AGE_KEY")
val NAME_KEY = stringPreferencesKey("NAME_KEY")
val MOBILE_NUMBER = longPreferencesKey("MOBILE_NUMBER")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment