Compare commits
No commits in common. "3394605d4a4b3abf880a4246d8a2bbbcc5a783ce" and "58ae02520a5f35ed027a3f3bfea182272ebc46ad" have entirely different histories.
3394605d4a
...
58ae02520a
|
@ -1248,8 +1248,6 @@ class TetrioPlayersLeaderboard {
|
||||||
lb.removeWhere((element) => element.country != country);
|
lb.removeWhere((element) => element.country != country);
|
||||||
}
|
}
|
||||||
lb.sort(((a, b) {
|
lb.sort(((a, b) {
|
||||||
if (a.getStatByEnum(stat).isNaN) return 1;
|
|
||||||
if (b.getStatByEnum(stat).isNaN) return -1;
|
|
||||||
if (a.getStatByEnum(stat) > b.getStatByEnum(stat)){
|
if (a.getStatByEnum(stat) > b.getStatByEnum(stat)){
|
||||||
return reversed ? 1 : -1;
|
return reversed ? 1 : -1;
|
||||||
}else if (a.getStatByEnum(stat) == b.getStatByEnum(stat)){
|
}else if (a.getStatByEnum(stat) == b.getStatByEnum(stat)){
|
||||||
|
@ -1261,6 +1259,20 @@ class TetrioPlayersLeaderboard {
|
||||||
return lb;
|
return lb;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
List<TetrioPlayerFromLeaderboard> getStatRankingSequel(Stats stat){
|
||||||
|
List<TetrioPlayerFromLeaderboard> lb = List.from(leaderboard);
|
||||||
|
lb.sort(((a, b) {
|
||||||
|
if (a.getStatByEnum(stat) > b.getStatByEnum(stat)){
|
||||||
|
return -1;
|
||||||
|
}else if (a.getStatByEnum(stat) == b.getStatByEnum(stat)){
|
||||||
|
return 0;
|
||||||
|
}else{
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
}));
|
||||||
|
return lb;
|
||||||
|
}
|
||||||
|
|
||||||
List<dynamic> getAverageOfRank(String rank){ // i tried to refactor it and that's was terrible
|
List<dynamic> getAverageOfRank(String rank){ // i tried to refactor it and that's was terrible
|
||||||
if (rank.isNotEmpty && !rankCutoffs.keys.contains(rank)) throw Exception("Invalid rank");
|
if (rank.isNotEmpty && !rankCutoffs.keys.contains(rank)) throw Exception("Invalid rank");
|
||||||
List<TetrioPlayerFromLeaderboard> filtredLeaderboard = List.from(leaderboard);
|
List<TetrioPlayerFromLeaderboard> filtredLeaderboard = List.from(leaderboard);
|
||||||
|
|
|
@ -75,7 +75,6 @@ class TLLeaderboardState extends State<TLLeaderboardView> {
|
||||||
case ConnectionState.done:
|
case ConnectionState.done:
|
||||||
final allPlayers = snapshot.data?.getStatRanking(snapshot.data!.leaderboard, _sortBy, reversed: reversed, country: _country);
|
final allPlayers = snapshot.data?.getStatRanking(snapshot.data!.leaderboard, _sortBy, reversed: reversed, country: _country);
|
||||||
if (!kIsWeb && !Platform.isAndroid && !Platform.isIOS) windowManager.setTitle("Tetra Stats: ${t.tlLeaderboard} - ${t.players(n: allPlayers!.length)}");
|
if (!kIsWeb && !Platform.isAndroid && !Platform.isIOS) windowManager.setTitle("Tetra Stats: ${t.tlLeaderboard} - ${t.players(n: allPlayers!.length)}");
|
||||||
bool bigScreen = MediaQuery.of(context).size.width > 768;
|
|
||||||
return NestedScrollView(
|
return NestedScrollView(
|
||||||
headerSliverBuilder: (context, value) {
|
headerSliverBuilder: (context, value) {
|
||||||
String howManyPlayers(int numberOfPlayers) => Intl.plural(
|
String howManyPlayers(int numberOfPlayers) => Intl.plural(
|
||||||
|
@ -171,26 +170,18 @@ class TLLeaderboardState extends State<TLLeaderboardView> {
|
||||||
},
|
},
|
||||||
body: ListView.builder(
|
body: ListView.builder(
|
||||||
itemCount: allPlayers!.length,
|
itemCount: allPlayers!.length,
|
||||||
prototypeItem: ListTile(
|
|
||||||
leading: Text("0", style: TextStyle(fontFamily: "Eurostile Round Extended", fontSize: bigScreen ? 28 : 24, height: 0.9)),
|
|
||||||
title: Text("ehhh...", style: TextStyle(fontFamily: bigScreen ? "Eurostile Round Extended" : "Eurostile Round", height: 0.9)),
|
|
||||||
trailing: Container(height: bigScreen ? 48 : 36, width: 1,),
|
|
||||||
subtitle: Text("eh..."),
|
|
||||||
),
|
|
||||||
itemBuilder: (context, index) {
|
itemBuilder: (context, index) {
|
||||||
|
bool bigScreen = MediaQuery.of(context).size.width > 768;
|
||||||
return ListTile(
|
return ListTile(
|
||||||
leading: Text(
|
leading: Text((index+1).toString(), style: bigScreen ? const TextStyle(fontFamily: "Eurostile Round Extended", fontSize: 28) : null),
|
||||||
(index+1).toString(),
|
title: Text(allPlayers[index].username, style: const TextStyle(fontFamily: "Eurostile Round Extended")),
|
||||||
style: TextStyle(fontFamily: "Eurostile Round Extended", fontSize: bigScreen ? 28 : 24, height: 0.9)
|
|
||||||
),
|
|
||||||
title: Text(allPlayers[index].username, style: TextStyle(fontFamily: bigScreen ? "Eurostile Round Extended" : "Eurostile Round", height: 0.9)),
|
|
||||||
subtitle: Text(_sortBy == Stats.tr ? "${f2.format(allPlayers[index].apm)} APM, ${f2.format(allPlayers[index].pps)} PPS, ${f2.format(allPlayers[index].vs)} VS, ${f2.format(allPlayers[index].nerdStats.app)} APP, ${f2.format(allPlayers[index].nerdStats.vsapm)} VS/APM" : "${_f4.format(allPlayers[index].getStatByEnum(_sortBy))} ${chartsShortTitles[_sortBy]}",
|
subtitle: Text(_sortBy == Stats.tr ? "${f2.format(allPlayers[index].apm)} APM, ${f2.format(allPlayers[index].pps)} PPS, ${f2.format(allPlayers[index].vs)} VS, ${f2.format(allPlayers[index].nerdStats.app)} APP, ${f2.format(allPlayers[index].nerdStats.vsapm)} VS/APM" : "${_f4.format(allPlayers[index].getStatByEnum(_sortBy))} ${chartsShortTitles[_sortBy]}",
|
||||||
style: TextStyle(fontFamily: "Eurostile Round Condensed", fontSize: bigScreen ? null : 12, color: _sortBy == Stats.tr ? Colors.grey : null)),
|
style: TextStyle(fontFamily: "Eurostile Round Condensed", color: _sortBy == Stats.tr ? Colors.grey : null)),
|
||||||
trailing: Row(
|
trailing: Row(
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
children: [
|
children: [
|
||||||
Text("${f2.format(allPlayers[index].rating)} TR", style: TextStyle(fontSize: bigScreen ? 28 : 22)),
|
Text("${f2.format(allPlayers[index].rating)} TR", style: bigScreen ? const TextStyle(fontSize: 28) : null),
|
||||||
Image.asset("res/tetrio_tl_alpha_ranks/${allPlayers[index].rank}.png", height: bigScreen ? 48 : 36),
|
Image.asset("res/tetrio_tl_alpha_ranks/${allPlayers[index].rank}.png", height: bigScreen ? 48 : 16),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
onTap: () {
|
onTap: () {
|
||||||
|
|
|
@ -2,7 +2,7 @@ name: tetra_stats
|
||||||
description: Track your and other player stats in TETR.IO
|
description: Track your and other player stats in TETR.IO
|
||||||
publish_to: 'none'
|
publish_to: 'none'
|
||||||
|
|
||||||
version: 1.5.2+18
|
version: 1.5.1+17
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
sdk: '>=3.0.0'
|
sdk: '>=3.0.0'
|
||||||
|
|
Loading…
Reference in New Issue