first person on leaderboard is actually first
This commit is contained in:
@@ -19,13 +19,15 @@ class LeaderboardPage extends StatelessWidget {
|
|||||||
color:
|
color:
|
||||||
isLoggedInUser ? Theme.of(context).colorScheme.secondary : null,
|
isLoggedInUser ? Theme.of(context).colorScheme.secondary : null,
|
||||||
child: ListTile(
|
child: ListTile(
|
||||||
leading: Text((index + 1).toString(),
|
leading: Text(
|
||||||
|
(index + 1).toString(),
|
||||||
style: Theme.of(context).textTheme.bodyLarge!.copyWith(
|
style: Theme.of(context).textTheme.bodyLarge!.copyWith(
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
color: isLoggedInUser
|
color: isLoggedInUser
|
||||||
? Theme.of(context).colorScheme.onSecondary
|
? Theme.of(context).colorScheme.onSecondary
|
||||||
: null,
|
: null,
|
||||||
)),
|
),
|
||||||
|
),
|
||||||
title: Text(
|
title: Text(
|
||||||
leaderboard.elementAt(index).username,
|
leaderboard.elementAt(index).username,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
@@ -34,13 +36,15 @@ class LeaderboardPage extends StatelessWidget {
|
|||||||
: null,
|
: null,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
trailing: Text(leaderboard.elementAt(index).points.toString(),
|
trailing: Text(
|
||||||
|
leaderboard.elementAt(index).points.toString(),
|
||||||
style: Theme.of(context).textTheme.bodyLarge!.copyWith(
|
style: Theme.of(context).textTheme.bodyLarge!.copyWith(
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
color: isLoggedInUser
|
color: isLoggedInUser
|
||||||
? Theme.of(context).colorScheme.onSecondary
|
? Theme.of(context).colorScheme.onSecondary
|
||||||
: null,
|
: null,
|
||||||
)),
|
),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -83,7 +83,10 @@ class DbHelper {
|
|||||||
|
|
||||||
static Future<List<Profile>> fetchProfiles() async {
|
static Future<List<Profile>> fetchProfiles() async {
|
||||||
List<Profile> items = [];
|
List<Profile> items = [];
|
||||||
final res = await _supabase.from('profiles').select();
|
final res = await _supabase.from('profiles').select().order(
|
||||||
|
'points',
|
||||||
|
ascending: false,
|
||||||
|
);
|
||||||
for (final map in res) {
|
for (final map in res) {
|
||||||
items.add(Profile.fromMap(map));
|
items.add(Profile.fromMap(map));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user