WhatsApp Clone — Jetpack Compose — Profile Details

Pradyot Prakash
2 min readAug 31, 2021

--

Photo by AltumCode on Unsplash

Having a profile page is a must in most of the application. So let’s create one. Right now we are not showing any major UI/Option. It’s just a basic layout and few details of the current user.

Profile page

We are using BottomSheetScaffold for showing a persistent bottom sheet for the user details (will be adding settings also).

Now since we will be needing user details in many places so let’s make a view model for our user details.

UserViewModel will be used for user related business logic.

Get user details

As the ProfileView is initiated get the user details from the Firestore. So for that getUserDetails method is called. And in FirestoreUtility a listener is added for user details.

Listen to user details

Again, the FirestoreCallbacks is used to return the results back to the view model.

When the result is sent, the UI is updated by the view model.

For showing an image from the url we are using Coil library. For details on the library can go to https://coil-kt.github.io/coil/compose/.

This is what is needed for the profile details as of now. As new features are added the article will also be updated. For now let’s move to the next part which is WhatsApp Clone — Jetpack Compose — Status.

--

--