How do we make a chat app where one can search another user and start private chat?

How do we make a chat app where one can search another user and start private chat? Please help me asap and please provide the blocks of that if possible.

I think you are not getting me. I mean to say that first I have made a group chat app using cloud db but now I want that users can just tap on any username or search the username and chat with them privately.

What you must code to make your app searchable for logged in users depends on how you made YOUR group chat CloudDB app. You did not share how you did that. What you need to do depends on what you already coded.

This link might prove useful for ideas How do you store a list in a tinydb (and for separate chat rooms) - #3 by SteveJG

You probably need a Tag showing all the 'signed in' users. Do you have a Tag like that?
Do you have a way to set up a chat only between two individuals and make a temporary chat room that is truly private? You possibly need to do that.

You need a way to contact the user you want to chat with. Have you thought about how you would do that? There are probably several different ways to do something like that.