Making a ranking system and Leaderboard

Widgets & Design

I am making an app where people go to nights and compete in events that score them points. Currently I have a value in the user collection "season_points". (I am using Firebase)

What I am hoping to do is get the app to give users a rank based on the number of points they have relative to everyone else. I would like to display what rank they are on one page, and provide a leaderboard where you can see all users on another. I have attached (image) a mock up of what I would like the leaderboard to look like, with the top three users on a podium type thing, and then 4th down in a list. I can appreciate that the podium (at least in the way I have envisioned it) may not be possible, so any other suggestions here are welcomed!

So far, I have used a list view and order by decreasing order of season_points to get them to display in order under 'Rankings', but obviously this shows all users, not "4th" down, and I was able to get the app to display the name of the person in first (I have a value "first_place" (in another collection) which takes the name (string) of the first result and updates the document with this value, but I imagine I can't do the same for a second and third place (taking the second and third results of the list view specifically) and even if I could, I am not sure how to then use that value to populate the rest of the podium (user picture and points total).

I would also like to present the user with information as to what their rank is on the home page, so I guess I would need the back end to get all the users, look at their points total, put them in order and then give the number as to what order they are in, and then display that number, but I have absolutely no idea how to do that (or if it is even possible).

I don't have any real experience with coding and so everything I have done so far has been through widgets. Any help or insight you could provide for either (or both) of these things would be extremely helpful!

What have you tried so far?

Searched the community for help. Used a list view to display my rankings (although not sure how to then "write" that somewhere to be used rather than displayed).

Did you check FlutterFlow's Documentation for this topic?
No
1
6 replies