Advertisement
grasswarlock

Untitled

Feb 16th, 2024
210
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Kotlin 0.79 KB | None | 0 0
  1. Row(
  2.     horizontalArrangement = Arrangement.spacedBy(10.dp),
  3.     verticalAlignment = Alignment.CenterVertically
  4. ) {
  5.     var avatar by rememberSaveable { mutableStateOf("") }
  6.     var displayname by rememberSaveable { mutableStateOf("") }
  7.  
  8.     //network function calls here
  9.     database.collection("Users").document(it.userid).get()
  10.         .addOnSuccessListener { document ->
  11.             avatar = document.data?.get("avatar").toString()
  12.             displayname = document.data?.get("displayname").toString()
  13.     Log.d("PosterData", avatar)
  14.     Log.d("PosterData", displayname)
  15. }
  16.       .addOnFailureListener { exception ->
  17.           Log.d(
  18.               "PosterData",
  19.               "Error getting user data: ",
  20.               exception
  21.           )
  22.       }
  23.  
  24.     //something inside of the row
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement