User management
data class User(
val uid: String,
val name: String,
val email: String,
val picture: FileUrl?,
)
val saveProfilePicture = SaveProfilePicture(args) // args are injected thanks to Koin
saveProfilePicture(byteArray)
Save Profile Picture
Imagine you want to create a ProfileScreen that save picture profile selected via gallery ou camera to the local file system and remote storage:
class ProfileScreenModel(
private val saveProfilePicture: SaveProfilePicture,
): ScreenModel {
fun saveProfilePicture(byteArray) {
this.saveProfilePicture(byteArray)
}
}
SaveProfilePicture saves in local file system the image then tries to send it to the remote storage.
Control the remote storage
suspend fun putFileAt(localFile: LocalFile, location: String): FileUrl
Last updated
Was this helpful?