I have a method that fetches all the users from the firebase database, and then I store all the users inside a list. let's say my list is:
user1 = User(
id: 1
name: "john"
car: false
)
user2 = User(
id: 2
name: "kim"
car: true
)
userList = [user1,user2]
How do I get the id of the user based on the name for example?