Skip to content

Instantly share code, notes, and snippets.

@GibsonRuitiari
Created September 6, 2022 14:35
Show Gist options
  • Save GibsonRuitiari/de8363b0ef5cd5dc366bb4b3d42d48af to your computer and use it in GitHub Desktop.
Save GibsonRuitiari/de8363b0ef5cd5dc366bb4b3d42d48af to your computer and use it in GitHub Desktop.
package com.ciru.practice
import androidx.compose.runtime.Stable
/**
* I have annotated the class with [@Stable] marker to enforce equality contract needed
* by compose compiler. This is a bit advanced but when you do get time, do look at the jetpack compose compiler docs
* This class holds data needed by your composables, it is good practice to scope your data into a data class instead
* of using primitive types (string, char, etc) with StateFlow
*/
@Stable
data class LoginData(val email:String,val username:String,val password:String){
companion object{
val EMPTY= LoginData("","","")
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment