Help needed for a Contacts app with pre-saved contacts on firebase cloud

okay I have designed the app on kodular now I have to do blocks only
App interface is like this
App has pre-saved contacts on firebase database
on the Search contact screen there are three text boxes i.e. Name, Cadre, District
to search a contact one must fill all three boxes with information
upon clicking the button Search contact, app shall show the closet match in result
there is also another option where user can select district, cadre or name and all the contacts in the selected category will be shown under
Please help me do blocks for it, I’ve been using chat gpt for help but its confusing me now

Show also your structure of firebase database