User

data class User(val name: String = "", val photoUri: String = "", val points: Float = 0.0f, val achievements: List<UserAchievement> = emptyList(), var isLoggedOut: Boolean = false)

A type of a document in the FbCollection.Users collection. The uuid used for this document should be equal to the FirebaseUser.uid which is unique per Firebase project Note: there's no need to convert it to a a Hashmap when adding it to a collection (since Firestore SDK for Kotlin Extensions update). This class just needs to be a data class and have default params in order for implicit deserialization to work at

doc.toObject<User>()

Instead of default params, another constructor with empty params could be defined, but it would require adding a rule in proguard-rules.proin order for minify to not strip the no argument constructor

  • https://firebase.google.com/docs/firestore/manage-data/add-data#custom_objects

Constructors

Link copied to clipboard
constructor(name: String = "", photoUri: String = "", points: Float = 0.0f, achievements: List<UserAchievement> = emptyList(), isLoggedOut: Boolean = false)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val points: Float = 0.0f

Functions

Link copied to clipboard

Used to avoid showing null fields, blank profile pic and other UI details when logging out

Link copied to clipboard
open override fun toString(): String