Kulwinder Singh
08/25/2019, 7:39 AMdata
class for Firestore and recently i had added fun isComplete(): Boolean
function to check if user info is complete but now whenever i use this data class to save/update user's object then there is new property isCompleted
is also saved on Firestore document and its value is also becomes true/false
depending on User object complete or incomplete. but why it is creating property for isComplete
funtion ?, is it something related to kotlin's getters/setters
?
data class User(
val uid: String? = null,
var name: String = "",
val age: String = "",
val gender: Gender = Gender.UNSELECTED
) {
fun isComplete(): Boolean {
return uid != null && name.isNotEmpty() && age.isNotEmpty() && gender != Gender.UNSELECTED
}
}