changes to leaderboard highlight
This commit is contained in:
@@ -1,10 +1,10 @@
|
|||||||
class Profile {
|
class Profile {
|
||||||
final String username;
|
final String username;
|
||||||
final int points;
|
final int points;
|
||||||
|
final String id;
|
||||||
|
|
||||||
Profile.fromMap(Map<String, dynamic> map)
|
Profile.fromMap(Map<String, dynamic> map)
|
||||||
: username = map['username'],
|
: username = map['username'],
|
||||||
points = map['points'] ?? 0;
|
points = map['points'] ?? 0,
|
||||||
|
id = map['id'];
|
||||||
Profile(this.username, this.points);
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:maggs_victory_voyage/services/db_helper.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
|
|
||||||
import '../models/profile.dart';
|
|
||||||
import '../services/profiles_provider.dart';
|
import '../services/profiles_provider.dart';
|
||||||
|
|
||||||
class LeaderboardPage extends StatelessWidget {
|
class LeaderboardPage extends StatelessWidget {
|
||||||
@@ -15,6 +14,8 @@ class LeaderboardPage extends StatelessWidget {
|
|||||||
itemCount: leaderboard.length,
|
itemCount: leaderboard.length,
|
||||||
itemBuilder: (BuildContext context, int index) {
|
itemBuilder: (BuildContext context, int index) {
|
||||||
return ListTile(
|
return ListTile(
|
||||||
|
selected:
|
||||||
|
leaderboard.elementAt(index).id == DbHelper.currentUser!.id,
|
||||||
leading: Text((index + 1).toString(),
|
leading: Text((index + 1).toString(),
|
||||||
style: Theme.of(context)
|
style: Theme.of(context)
|
||||||
.textTheme
|
.textTheme
|
||||||
|
|||||||
Reference in New Issue
Block a user