changes to leaderboard highlight

This commit is contained in:
SomnusVeritas
2023-10-20 23:42:51 +02:00
parent bfd2d2c337
commit ce6722d73f
2 changed files with 6 additions and 5 deletions

View File

@@ -1,10 +1,10 @@
class Profile {
final String username;
final int points;
final String id;
Profile.fromMap(Map<String, dynamic> map)
: username = map['username'],
points = map['points'] ?? 0;
Profile(this.username, this.points);
points = map['points'] ?? 0,
id = map['id'];
}

View File

@@ -1,7 +1,6 @@
import 'package:flutter/material.dart';
import 'package:maggs_victory_voyage/services/db_helper.dart';
import 'package:provider/provider.dart';
import '../models/profile.dart';
import '../services/profiles_provider.dart';
class LeaderboardPage extends StatelessWidget {
@@ -15,6 +14,8 @@ class LeaderboardPage extends StatelessWidget {
itemCount: leaderboard.length,
itemBuilder: (BuildContext context, int index) {
return ListTile(
selected:
leaderboard.elementAt(index).id == DbHelper.currentUser!.id,
leading: Text((index + 1).toString(),
style: Theme.of(context)
.textTheme