Firebase provides a bunch of awesome services such as Firestore, Auth, Cloud Storage, Cloud Functions and Cloud Messaging. Learn how to use them in this tutorial course in which we’re making a fully fledged real-time chat app with everything you’d expect like sending images and getting notifications when we receive a new message.

In this part you will learn how to set up the accounts of your users. We will create a User class and save it to Firestore database. We will also use Firebase Cloud Storage to save the profile picture.

This post contains all the code that’s been written in this YouTube video.

 

To get the code check out this GitHub repository: https://github.com/ResoCoder/firebase-firestore-chat-app

About the author 

Matt Rešetár

Matt is an app developer with a knack for teaching others. Working as a freelancer and most importantly developer educator, he is set on helping other people succeed in their Flutter app development career.

You may also like

  • doest work at all
    fun initCurrentUserIfFirstTime(onComplete: () -> Unit) {
    currentUserDocRef.get().addOnSuccessListener { documentSnapshot ->
    if (!documentSnapshot.exists()) {
    val newUser = User(FirebaseAuth.getInstance().currentUser?.displayName ?: “”,
    “”, null, mutableListOf())
    currentUserDocRef.set(newUser).addOnSuccessListener {
    onComplete()
    }
    }
    else
    onComplete()
    }
    }

    type inference failed mutablelistOf
    none of the following fuctions can be called with the arguments supplied

  • I face a problem when I press the My Account button, the application will be stopped, please answer

  • {"email":"Email address invalid","url":"Website address invalid","required":"Required field missing"}
    >