some progress?

This commit is contained in:
dan63047 2024-10-30 01:10:19 +03:00
parent ae7d92fcac
commit 5b1a54c59e
4 changed files with 283 additions and 131 deletions

View File

@ -11,6 +11,7 @@ class RecordSingle {
late String replayId; late String replayId;
late String ownId; late String ownId;
late String gamemode; late String gamemode;
String? revolution;
late DateTime timestamp; late DateTime timestamp;
late ResultsStats stats; late ResultsStats stats;
late int rank; late int rank;
@ -35,6 +36,7 @@ class RecordSingle {
countryRank = cran; countryRank = cran;
aggregateStats = AggregateStats.fromJson(json['results']['aggregatestats']); aggregateStats = AggregateStats.fromJson(json['results']['aggregatestats']);
prisecter = Prisecter.fromJson(json['p']); prisecter = Prisecter.fromJson(json['p']);
revolution = json["revolution"];
var ex = json['extras'] as Map<String, dynamic>; var ex = json['extras'] as Map<String, dynamic>;
switch (ex.keys.firstOrNull){ switch (ex.keys.firstOrNull){
case "zenith": case "zenith":

View File

@ -7,6 +7,7 @@ import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:intl/intl.dart'; import 'package:intl/intl.dart';
import 'package:tetra_stats/data_objects/aggregate_stats.dart'; import 'package:tetra_stats/data_objects/aggregate_stats.dart';
import 'package:tetra_stats/data_objects/record_single.dart';
import 'package:tetra_stats/data_objects/summaries.dart'; import 'package:tetra_stats/data_objects/summaries.dart';
import 'package:tetra_stats/data_objects/tetrio_constants.dart'; import 'package:tetra_stats/data_objects/tetrio_constants.dart';
import 'package:tetra_stats/data_objects/tetrio_player.dart'; import 'package:tetra_stats/data_objects/tetrio_player.dart';
@ -143,18 +144,46 @@ class CompareState extends State<CompareView> {
"Key Presses Per Piece", "Key Presses Per Piece",
"Pieces Per Second", "Pieces Per Second",
"Key Presses Per Second", "Key Presses Per Second",
"" "Finesse",
// TODO: line clears "Finesse Faults",
// TODO: spins "",
"Quads",
"Triples",
"Doubles",
"Singles",
"",
"T-spins triples",
"T-spins doubles",
"T-spins singles",
"T-spins zeros",
"Mini T-spins doubles",
"Mini T-spins singles",
"Mini T-spins zeros"
], ],
"Blitz": [ "Blitz": [
"Score", "Score",
"Pieces", "Pieces",
"Lines",
"Level",
"Inputs", "Inputs",
"Key Presses Per Piece", "Key Presses Per Piece",
"Pieces Per Second", "Pieces Per Second",
"Key Presses Per Second", "Key Presses Per Second",
"" "Finesse",
"Finesse Faults",
"",
"Quads",
"Triples",
"Doubles",
"Singles",
"",
"T-spins triples",
"T-spins doubles",
"T-spins singles",
"T-spins zeros",
"Mini T-spins doubles",
"Mini T-spins singles",
"Mini T-spins zeros"
], ],
"Zen": [ "Zen": [
"Score", "Score",
@ -184,6 +213,10 @@ class CompareState extends State<CompareView> {
} }
addvaluesEntrys(TetrioPlayer p, Summaries s){ addvaluesEntrys(TetrioPlayer p, Summaries s){
RecordSingle? zenithRun = s.zenith != null ? s.zenith : s.zenithCareerBest;
bool oldZenithRun = s.zenith == null;
RecordSingle? zenithExRun = s.zenithEx != null ? s.zenithEx : s.zenithExCareerBest;
bool oldZenithExRun = s.zenithEx == null;
rawValues[0].add([ rawValues[0].add([
p.registrationTime, p.registrationTime,
p.xp, p.xp,
@ -224,60 +257,60 @@ class CompareState extends State<CompareView> {
] ]
); );
rawValues[2].add([ rawValues[2].add([
s.zenith?.stats.zenith?.altitude, zenithRun?.stats.zenith?.altitude,
s.zenith?.rank, zenithRun?.rank,
s.zenith?.aggregateStats.apm, zenithRun?.aggregateStats.apm,
s.zenith?.aggregateStats.pps, zenithRun?.aggregateStats.pps,
s.zenith?.aggregateStats.vs, zenithRun?.aggregateStats.vs,
s.zenith?.stats.kills, zenithRun?.stats.kills,
s.zenith?.stats.topBtB, zenithRun?.stats.topBtB,
s.zenith?.stats.cps, zenithRun?.stats.cps,
s.zenith?.stats.zenith?.peakrank, zenithRun?.stats.zenith?.peakrank,
s.zenith?.stats.finalTime, zenithRun?.stats.finalTime,
s.zenith?.stats.finessePercentage, zenithRun?.stats.finessePercentage,
"", "",
s.zenith?.aggregateStats.nerdStats.app, zenithRun?.aggregateStats.nerdStats.app,
s.zenith?.aggregateStats.nerdStats.vsapm, zenithRun?.aggregateStats.nerdStats.vsapm,
s.zenith?.aggregateStats.nerdStats.dss, zenithRun?.aggregateStats.nerdStats.dss,
s.zenith?.aggregateStats.nerdStats.dsp, zenithRun?.aggregateStats.nerdStats.dsp,
s.zenith?.aggregateStats.nerdStats.appdsp, zenithRun?.aggregateStats.nerdStats.appdsp,
s.zenith?.aggregateStats.nerdStats.cheese, zenithRun?.aggregateStats.nerdStats.cheese,
s.zenith?.aggregateStats.nerdStats.gbe, zenithRun?.aggregateStats.nerdStats.gbe,
s.zenith?.aggregateStats.nerdStats.nyaapp, zenithRun?.aggregateStats.nerdStats.nyaapp,
s.zenith?.aggregateStats.nerdStats.area, zenithRun?.aggregateStats.nerdStats.area,
"", "",
s.zenith?.aggregateStats.playstyle.opener, zenithRun?.aggregateStats.playstyle.opener,
s.zenith?.aggregateStats.playstyle.plonk, zenithRun?.aggregateStats.playstyle.plonk,
s.zenith?.aggregateStats.playstyle.stride, zenithRun?.aggregateStats.playstyle.stride,
s.zenith?.aggregateStats.playstyle.infds, zenithRun?.aggregateStats.playstyle.infds,
]); ]);
rawValues[3].add([ rawValues[3].add([
s.zenithEx?.stats.zenith?.altitude, zenithExRun?.stats.zenith?.altitude,
s.zenithEx?.rank, zenithExRun?.rank,
s.zenithEx?.aggregateStats.apm, zenithExRun?.aggregateStats.apm,
s.zenithEx?.aggregateStats.pps, zenithExRun?.aggregateStats.pps,
s.zenithEx?.aggregateStats.vs, zenithExRun?.aggregateStats.vs,
s.zenithEx?.stats.kills, zenithExRun?.stats.kills,
s.zenithEx?.stats.topBtB, zenithExRun?.stats.topBtB,
s.zenithEx?.stats.cps, zenithExRun?.stats.cps,
s.zenithEx?.stats.zenith?.peakrank, zenithExRun?.stats.zenith?.peakrank,
s.zenithEx?.stats.finalTime, zenithExRun?.stats.finalTime,
s.zenithEx?.stats.finessePercentage, zenithExRun?.stats.finessePercentage,
"", "",
s.zenithEx?.aggregateStats.nerdStats.app, zenithExRun?.aggregateStats.nerdStats.app,
s.zenithEx?.aggregateStats.nerdStats.vsapm, zenithExRun?.aggregateStats.nerdStats.vsapm,
s.zenithEx?.aggregateStats.nerdStats.dss, zenithExRun?.aggregateStats.nerdStats.dss,
s.zenithEx?.aggregateStats.nerdStats.dsp, zenithExRun?.aggregateStats.nerdStats.dsp,
s.zenithEx?.aggregateStats.nerdStats.appdsp, zenithExRun?.aggregateStats.nerdStats.appdsp,
s.zenithEx?.aggregateStats.nerdStats.cheese, zenithExRun?.aggregateStats.nerdStats.cheese,
s.zenithEx?.aggregateStats.nerdStats.gbe, zenithExRun?.aggregateStats.nerdStats.gbe,
s.zenithEx?.aggregateStats.nerdStats.nyaapp, zenithExRun?.aggregateStats.nerdStats.nyaapp,
s.zenithEx?.aggregateStats.nerdStats.area, zenithExRun?.aggregateStats.nerdStats.area,
"", "",
s.zenithEx?.aggregateStats.playstyle.opener, zenithExRun?.aggregateStats.playstyle.opener,
s.zenithEx?.aggregateStats.playstyle.plonk, zenithExRun?.aggregateStats.playstyle.plonk,
s.zenithEx?.aggregateStats.playstyle.stride, zenithExRun?.aggregateStats.playstyle.stride,
s.zenithEx?.aggregateStats.playstyle.infds, zenithExRun?.aggregateStats.playstyle.infds,
]);; ]);;
rawValues[4].add([ rawValues[4].add([
s.sprint?.stats.finalTime, s.sprint?.stats.finalTime,
@ -285,16 +318,48 @@ class CompareState extends State<CompareView> {
s.sprint?.stats.inputs, s.sprint?.stats.inputs,
s.sprint?.stats.kpp, s.sprint?.stats.kpp,
s.sprint?.stats.pps, s.sprint?.stats.pps,
s.sprint?.stats.kps s.sprint?.stats.kps,
s.sprint?.stats.finessePercentage,
s.sprint?.stats.finesse?.faults,
"",
s.sprint?.stats.clears.quads,
s.sprint?.stats.clears.triples,
s.sprint?.stats.clears.doubles,
s.sprint?.stats.clears.singles,
"",
s.sprint?.stats.clears.tSpinTriples,
s.sprint?.stats.clears.tSpinDoubles,
s.sprint?.stats.clears.tSpinSingles,
s.sprint?.stats.clears.tSpinZeros,
s.sprint?.stats.clears.tSpinMiniDoubles,
s.sprint?.stats.clears.tSpinMiniSingles,
s.sprint?.stats.clears.tSpinMiniZeros
]); ]);
rawValues[5].add( rawValues[5].add(
[ [
s.blitz?.stats.score, s.blitz?.stats.score,
s.blitz?.stats.piecesPlaced, s.blitz?.stats.piecesPlaced,
s.blitz?.stats.lines,
s.blitz?.stats.level,
s.blitz?.stats.inputs, s.blitz?.stats.inputs,
s.blitz?.stats.kpp, s.blitz?.stats.kpp,
s.blitz?.stats.pps, s.blitz?.stats.pps,
s.blitz?.stats.kps s.blitz?.stats.kps,
s.blitz?.stats.finessePercentage,
s.blitz?.stats.finesse?.faults,
"",
s.blitz?.stats.clears.quads,
s.blitz?.stats.clears.triples,
s.blitz?.stats.clears.doubles,
s.blitz?.stats.clears.singles,
"",
s.blitz?.stats.clears.tSpinTriples,
s.blitz?.stats.clears.tSpinDoubles,
s.blitz?.stats.clears.tSpinSingles,
s.blitz?.stats.clears.tSpinZeros,
s.blitz?.stats.clears.tSpinMiniDoubles,
s.blitz?.stats.clears.tSpinMiniSingles,
s.blitz?.stats.clears.tSpinMiniZeros
] ]
); );
rawValues[6].add([ rawValues[6].add([
@ -339,60 +404,60 @@ class CompareState extends State<CompareView> {
Text(s.league.playstyle != null ? f4.format(s.league.playstyle!.infds) : "---"), Text(s.league.playstyle != null ? f4.format(s.league.playstyle!.infds) : "---"),
]); ]);
formattedValues[2].add([ formattedValues[2].add([
Text(s.zenith != null ? f4.format(s.zenith!.stats.zenith!.altitude) : "---"), RichText(text: TextSpan(text: zenithRun != null ? "${f2.format(zenithRun.stats.zenith!.altitude)} m" : "---", style: TextStyle(fontFamily: "Eurostile Round"), children: [if (zenithRun != null && oldZenithRun) TextSpan(text: " (${zenithRun.revolution})", style: TextStyle(color: Colors.grey))])),
Text(s.zenith != null ? ""+intf.format(s.zenith!.rank) : "---"), Text(zenithRun != null ? ""+intf.format(zenithRun.rank) : "---"),
Text(s.zenith != null ? f2.format(s.zenith!.aggregateStats.apm) : "---"), Text(zenithRun != null ? f2.format(zenithRun.aggregateStats.apm) : "---"),
Text(s.zenith != null ? f2.format(s.zenith!.aggregateStats.pps) : "---"), Text(zenithRun != null ? f2.format(zenithRun.aggregateStats.pps) : "---"),
Text(s.zenith != null ? f2.format(s.zenith!.aggregateStats.vs) : "---"), Text(zenithRun != null ? f2.format(zenithRun.aggregateStats.vs) : "---"),
Text(s.zenith != null ? intf.format(s.zenith!.stats.kills) : "---"), Text(zenithRun != null ? intf.format(zenithRun.stats.kills) : "---"),
Text(s.zenith != null ? intf.format(s.zenith!.stats.topBtB) : "---"), Text(zenithRun != null ? intf.format(zenithRun.stats.topBtB) : "---"),
Text(s.zenith != null ? f4.format(s.zenith!.stats.cps) : "---"), Text(zenithRun != null ? f4.format(zenithRun.stats.cps) : "---"),
Text(s.zenith != null ? f4.format(s.zenith!.stats.zenith!.peakrank) : "---"), Text(zenithRun != null ? f4.format(zenithRun.stats.zenith!.peakrank) : "---"),
Text(s.zenith != null ? getMoreNormalTime(s.zenith!.stats.finalTime) : "---"), Text(zenithRun != null ? getMoreNormalTime(zenithRun.stats.finalTime) : "---"),
Text(s.zenith != null ? f2.format(s.zenith!.stats.finessePercentage*100)+"%" : "---"), Text(zenithRun != null ? f2.format(zenithRun.stats.finessePercentage*100)+"%" : "---"),
Text(""), Text(""),
Text(s.zenith?.aggregateStats.nerdStats != null ? f4.format(s.zenith!.aggregateStats.nerdStats.app) : "---"), Text(zenithRun?.aggregateStats.nerdStats != null ? f4.format(zenithRun!.aggregateStats.nerdStats.app) : "---"),
Text(s.zenith?.aggregateStats.nerdStats != null ? f4.format(s.zenith!.aggregateStats.nerdStats.vsapm) : "---"), Text(zenithRun?.aggregateStats.nerdStats != null ? f4.format(zenithRun!.aggregateStats.nerdStats.vsapm) : "---"),
Text(s.zenith?.aggregateStats.nerdStats != null ? f4.format(s.zenith!.aggregateStats.nerdStats.dss) : "---"), Text(zenithRun?.aggregateStats.nerdStats != null ? f4.format(zenithRun!.aggregateStats.nerdStats.dss) : "---"),
Text(s.zenith?.aggregateStats.nerdStats != null ? f4.format(s.zenith!.aggregateStats.nerdStats.dsp) : "---"), Text(zenithRun?.aggregateStats.nerdStats != null ? f4.format(zenithRun!.aggregateStats.nerdStats.dsp) : "---"),
Text(s.zenith?.aggregateStats.nerdStats != null ? f4.format(s.zenith!.aggregateStats.nerdStats.appdsp) : "---"), Text(zenithRun?.aggregateStats.nerdStats != null ? f4.format(zenithRun!.aggregateStats.nerdStats.appdsp) : "---"),
Text(s.zenith?.aggregateStats.nerdStats != null ? f4.format(s.zenith!.aggregateStats.nerdStats.cheese) : "---"), Text(zenithRun?.aggregateStats.nerdStats != null ? f4.format(zenithRun!.aggregateStats.nerdStats.cheese) : "---"),
Text(s.zenith?.aggregateStats.nerdStats != null ? f4.format(s.zenith!.aggregateStats.nerdStats.gbe) : "---"), Text(zenithRun?.aggregateStats.nerdStats != null ? f4.format(zenithRun!.aggregateStats.nerdStats.gbe) : "---"),
Text(s.zenith?.aggregateStats.nerdStats != null ? f4.format(s.zenith!.aggregateStats.nerdStats.nyaapp) : "---"), Text(zenithRun?.aggregateStats.nerdStats != null ? f4.format(zenithRun!.aggregateStats.nerdStats.nyaapp) : "---"),
Text(s.zenith?.aggregateStats.nerdStats != null ? f4.format(s.zenith!.aggregateStats.nerdStats.area) : "---"), Text(zenithRun?.aggregateStats.nerdStats != null ? f4.format(zenithRun!.aggregateStats.nerdStats.area) : "---"),
Text(""), Text(""),
Text(s.zenith?.aggregateStats.playstyle != null ? f4.format(s.zenith!.aggregateStats.playstyle.opener) : "---"), Text(zenithRun?.aggregateStats.playstyle != null ? f4.format(zenithRun!.aggregateStats.playstyle.opener) : "---"),
Text(s.zenith?.aggregateStats.playstyle != null ? f4.format(s.zenith!.aggregateStats.playstyle.plonk) : "---"), Text(zenithRun?.aggregateStats.playstyle != null ? f4.format(zenithRun!.aggregateStats.playstyle.plonk) : "---"),
Text(s.zenith?.aggregateStats.playstyle != null ? f4.format(s.zenith!.aggregateStats.playstyle.stride) : "---"), Text(zenithRun?.aggregateStats.playstyle != null ? f4.format(zenithRun!.aggregateStats.playstyle.stride) : "---"),
Text(s.zenith?.aggregateStats.playstyle != null ? f4.format(s.zenith!.aggregateStats.playstyle.infds) : "---"), Text(zenithRun?.aggregateStats.playstyle != null ? f4.format(zenithRun!.aggregateStats.playstyle.infds) : "---"),
]); ]);
formattedValues[3].add([ formattedValues[3].add([
Text(s.zenith != null ? f4.format(s.zenith!.stats.zenith!.altitude) : "---"), RichText(text: TextSpan(text: zenithExRun != null ? "${f2.format(zenithExRun.stats.zenith!.altitude)} m" : "---", style: TextStyle(fontFamily: "Eurostile Round"), children: [if (zenithExRun != null && oldZenithExRun) TextSpan(text: " (${zenithExRun.revolution})", style: TextStyle(color: Colors.grey))])),
Text(s.zenith != null ? ""+intf.format(s.zenith!.rank) : "---"), Text(zenithExRun != null ? ""+intf.format(zenithExRun.rank) : "---"),
Text(s.zenith != null ? f2.format(s.zenith!.aggregateStats.apm) : "---"), Text(zenithExRun != null ? f2.format(zenithExRun.aggregateStats.apm) : "---"),
Text(s.zenith != null ? f2.format(s.zenith!.aggregateStats.pps) : "---"), Text(zenithExRun != null ? f2.format(zenithExRun.aggregateStats.pps) : "---"),
Text(s.zenith != null ? f2.format(s.zenith!.aggregateStats.vs) : "---"), Text(zenithExRun != null ? f2.format(zenithExRun.aggregateStats.vs) : "---"),
Text(s.zenith != null ? intf.format(s.zenith!.stats.kills) : "---"), Text(zenithExRun != null ? intf.format(zenithExRun.stats.kills) : "---"),
Text(s.zenith != null ? intf.format(s.zenith!.stats.topBtB) : "---"), Text(zenithExRun != null ? intf.format(zenithExRun.stats.topBtB) : "---"),
Text(s.zenith != null ? f4.format(s.zenith!.stats.cps) : "---"), Text(zenithExRun != null ? f4.format(zenithExRun.stats.cps) : "---"),
Text(s.zenith != null ? f4.format(s.zenith!.stats.zenith!.peakrank) : "---"), Text(zenithExRun != null ? f4.format(zenithExRun.stats.zenith!.peakrank) : "---"),
Text(s.zenith != null ? getMoreNormalTime(s.zenith!.stats.finalTime) : "---"), Text(zenithExRun != null ? getMoreNormalTime(zenithExRun.stats.finalTime) : "---"),
Text(s.zenith != null ? f2.format(s.zenith!.stats.finessePercentage*100)+"%" : "---"), Text(zenithExRun != null ? f2.format(zenithExRun.stats.finessePercentage*100)+"%" : "---"),
Text(""), Text(""),
Text(s.zenith?.aggregateStats.nerdStats != null ? f4.format(s.zenith!.aggregateStats.nerdStats.app) : "---"), Text(zenithExRun?.aggregateStats.nerdStats != null ? f4.format(zenithExRun!.aggregateStats.nerdStats.app) : "---"),
Text(s.zenith?.aggregateStats.nerdStats != null ? f4.format(s.zenith!.aggregateStats.nerdStats.vsapm) : "---"), Text(zenithExRun?.aggregateStats.nerdStats != null ? f4.format(zenithExRun!.aggregateStats.nerdStats.vsapm) : "---"),
Text(s.zenith?.aggregateStats.nerdStats != null ? f4.format(s.zenith!.aggregateStats.nerdStats.dss) : "---"), Text(zenithExRun?.aggregateStats.nerdStats != null ? f4.format(zenithExRun!.aggregateStats.nerdStats.dss) : "---"),
Text(s.zenith?.aggregateStats.nerdStats != null ? f4.format(s.zenith!.aggregateStats.nerdStats.dsp) : "---"), Text(zenithExRun?.aggregateStats.nerdStats != null ? f4.format(zenithExRun!.aggregateStats.nerdStats.dsp) : "---"),
Text(s.zenith?.aggregateStats.nerdStats != null ? f4.format(s.zenith!.aggregateStats.nerdStats.appdsp) : "---"), Text(zenithExRun?.aggregateStats.nerdStats != null ? f4.format(zenithExRun!.aggregateStats.nerdStats.appdsp) : "---"),
Text(s.zenith?.aggregateStats.nerdStats != null ? f4.format(s.zenith!.aggregateStats.nerdStats.cheese) : "---"), Text(zenithExRun?.aggregateStats.nerdStats != null ? f4.format(zenithExRun!.aggregateStats.nerdStats.cheese) : "---"),
Text(s.zenith?.aggregateStats.nerdStats != null ? f4.format(s.zenith!.aggregateStats.nerdStats.gbe) : "---"), Text(zenithExRun?.aggregateStats.nerdStats != null ? f4.format(zenithExRun!.aggregateStats.nerdStats.gbe) : "---"),
Text(s.zenith?.aggregateStats.nerdStats != null ? f4.format(s.zenith!.aggregateStats.nerdStats.nyaapp) : "---"), Text(zenithExRun?.aggregateStats.nerdStats != null ? f4.format(zenithExRun!.aggregateStats.nerdStats.nyaapp) : "---"),
Text(s.zenith?.aggregateStats.nerdStats != null ? f4.format(s.zenith!.aggregateStats.nerdStats.area) : "---"), Text(zenithExRun?.aggregateStats.nerdStats != null ? f4.format(zenithExRun!.aggregateStats.nerdStats.area) : "---"),
Text(""), Text(""),
Text(s.zenith?.aggregateStats.playstyle != null ? f4.format(s.zenith!.aggregateStats.playstyle.opener) : "---"), Text(zenithExRun?.aggregateStats.playstyle != null ? f4.format(zenithExRun!.aggregateStats.playstyle.opener) : "---"),
Text(s.zenith?.aggregateStats.playstyle != null ? f4.format(s.zenith!.aggregateStats.playstyle.plonk) : "---"), Text(zenithExRun?.aggregateStats.playstyle != null ? f4.format(zenithExRun!.aggregateStats.playstyle.plonk) : "---"),
Text(s.zenith?.aggregateStats.playstyle != null ? f4.format(s.zenith!.aggregateStats.playstyle.stride) : "---"), Text(zenithExRun?.aggregateStats.playstyle != null ? f4.format(zenithExRun!.aggregateStats.playstyle.stride) : "---"),
Text(s.zenith?.aggregateStats.playstyle != null ? f4.format(s.zenith!.aggregateStats.playstyle.infds) : "---"), Text(zenithExRun?.aggregateStats.playstyle != null ? f4.format(zenithExRun!.aggregateStats.playstyle.infds) : "---"),
]); ]);
formattedValues[4].add([ formattedValues[4].add([
Text(s.sprint != null ? getMoreNormalTime(s.sprint!.stats.finalTime) : "---"), Text(s.sprint != null ? getMoreNormalTime(s.sprint!.stats.finalTime) : "---"),
@ -400,15 +465,47 @@ class CompareState extends State<CompareView> {
Text(s.sprint != null ? intf.format(s.sprint!.stats.inputs) : "---"), Text(s.sprint != null ? intf.format(s.sprint!.stats.inputs) : "---"),
Text(s.sprint != null ? f4.format(s.sprint!.stats.kpp) : "---"), Text(s.sprint != null ? f4.format(s.sprint!.stats.kpp) : "---"),
Text(s.sprint != null ? f4.format(s.sprint!.stats.pps) : "---"), Text(s.sprint != null ? f4.format(s.sprint!.stats.pps) : "---"),
Text(s.sprint != null ? f4.format(s.sprint!.stats.kps) : "---") Text(s.sprint != null ? f4.format(s.sprint!.stats.kps) : "---"),
Text(s.sprint != null ? percentage.format(s.sprint!.stats.finessePercentage) : "---"),
Text(s.sprint != null ? intf.format(s.sprint!.stats.finesse?.faults) : "---"),
Text(""),
Text(s.sprint != null ? intf.format(s.sprint!.stats.clears.quads) : "---"),
Text(s.sprint != null ? intf.format(s.sprint!.stats.clears.triples) : "---"),
Text(s.sprint != null ? intf.format(s.sprint!.stats.clears.doubles) : "---"),
Text(s.sprint != null ? intf.format(s.sprint!.stats.clears.singles) : "---"),
Text(""),
Text(s.sprint != null ? intf.format(s.sprint!.stats.clears.tSpinTriples) : "---"),
Text(s.sprint != null ? intf.format(s.sprint!.stats.clears.tSpinDoubles) : "---"),
Text(s.sprint != null ? intf.format(s.sprint!.stats.clears.tSpinSingles) : "---"),
Text(s.sprint != null ? intf.format(s.sprint!.stats.clears.tSpinZeros) : "---"),
Text(s.sprint != null ? intf.format(s.sprint!.stats.clears.tSpinMiniDoubles) : "---"),
Text(s.sprint != null ? intf.format(s.sprint!.stats.clears.tSpinMiniSingles) : "---"),
Text(s.sprint != null ? intf.format(s.sprint!.stats.clears.tSpinMiniZeros) : "---"),
]); ]);
formattedValues[5].add([ formattedValues[5].add([
Text(s.blitz != null ? intf.format(s.sprint!.stats.score) : "---"), Text(s.blitz != null ? intf.format(s.blitz!.stats.score) : "---"),
Text(s.blitz != null ? intf.format(s.blitz!.stats.piecesPlaced) : "---"), Text(s.blitz != null ? intf.format(s.blitz!.stats.piecesPlaced) : "---"),
Text(s.blitz != null ? intf.format(s.blitz!.stats.lines) : "---"),
Text(s.blitz != null ? intf.format(s.blitz!.stats.level) : "---"),
Text(s.blitz != null ? intf.format(s.blitz!.stats.inputs) : "---"), Text(s.blitz != null ? intf.format(s.blitz!.stats.inputs) : "---"),
Text(s.blitz != null ? f4.format(s.blitz!.stats.kpp) : "---"), Text(s.blitz != null ? f4.format(s.blitz!.stats.kpp) : "---"),
Text(s.blitz != null ? f4.format(s.blitz!.stats.pps) : "---"), Text(s.blitz != null ? f4.format(s.blitz!.stats.pps) : "---"),
Text(s.blitz != null ? f4.format(s.blitz!.stats.kps) : "---") Text(s.blitz != null ? f4.format(s.blitz!.stats.kps) : "---"),
Text(s.blitz != null ? percentage.format(s.blitz!.stats.finessePercentage) : "---"),
Text(s.blitz != null ? intf.format(s.blitz!.stats.finesse?.faults) : "---"),
Text(""),
Text(s.blitz != null ? intf.format(s.blitz!.stats.clears.quads) : "---"),
Text(s.blitz != null ? intf.format(s.blitz!.stats.clears.triples) : "---"),
Text(s.blitz != null ? intf.format(s.blitz!.stats.clears.doubles) : "---"),
Text(s.blitz != null ? intf.format(s.blitz!.stats.clears.singles) : "---"),
Text(""),
Text(s.blitz != null ? intf.format(s.blitz!.stats.clears.tSpinTriples) : "---"),
Text(s.blitz != null ? intf.format(s.blitz!.stats.clears.tSpinDoubles) : "---"),
Text(s.blitz != null ? intf.format(s.blitz!.stats.clears.tSpinSingles) : "---"),
Text(s.blitz != null ? intf.format(s.blitz!.stats.clears.tSpinZeros) : "---"),
Text(s.blitz != null ? intf.format(s.blitz!.stats.clears.tSpinMiniDoubles) : "---"),
Text(s.blitz != null ? intf.format(s.blitz!.stats.clears.tSpinMiniSingles) : "---"),
Text(s.blitz != null ? intf.format(s.blitz!.stats.clears.tSpinMiniZeros) : "---"),
]); ]);
formattedValues[6].add([ formattedValues[6].add([
Text(intf.format(s.zen.score)), Text(intf.format(s.zen.score)),
@ -429,7 +526,7 @@ class CompareState extends State<CompareView> {
[ [
summaries.reduce((curr, next) => curr.league.tr > next.league.tr ? curr : next).league.tr, summaries.reduce((curr, next) => curr.league.tr > next.league.tr ? curr : next).league.tr,
summaries.reduce((curr, next) => (curr.league.glicko??-1) > (next.league.glicko??-1) ? curr : next).league.glicko, summaries.reduce((curr, next) => (curr.league.glicko??-1) > (next.league.glicko??-1) ? curr : next).league.glicko,
summaries.reduce((curr, next) => (curr.league.rd??-1) > (next.league.rd??-1) ? curr : next).league.rd, summaries.reduce((curr, next) => (curr.league.rd??-1) < (next.league.rd??-1) ? curr : next).league.rd,
summaries.reduce((curr, next) => curr.league.gxe > next.league.gxe ? curr : next).league.gxe, summaries.reduce((curr, next) => curr.league.gxe > next.league.gxe ? curr : next).league.gxe,
summaries.reduce((curr, next) => curr.league.s1tr > next.league.s1tr ? curr : next).league.s1tr, summaries.reduce((curr, next) => curr.league.s1tr > next.league.s1tr ? curr : next).league.s1tr,
summaries.reduce((curr, next) => curr.league.standing > next.league.standing ? curr : next).league.standing, summaries.reduce((curr, next) => curr.league.standing > next.league.standing ? curr : next).league.standing,
@ -518,14 +615,46 @@ class CompareState extends State<CompareView> {
summaries.reduce((curr, next) => (curr.sprint?.stats.kpp??-1) < (next.sprint?.stats.kpp??-1) ? curr : next).sprint?.stats.kpp, summaries.reduce((curr, next) => (curr.sprint?.stats.kpp??-1) < (next.sprint?.stats.kpp??-1) ? curr : next).sprint?.stats.kpp,
summaries.reduce((curr, next) => (curr.sprint?.stats.pps??-1) > (next.sprint?.stats.pps??-1) ? curr : next).sprint?.stats.pps, summaries.reduce((curr, next) => (curr.sprint?.stats.pps??-1) > (next.sprint?.stats.pps??-1) ? curr : next).sprint?.stats.pps,
summaries.reduce((curr, next) => (curr.sprint?.stats.kps??-1) > (next.sprint?.stats.kps??-1) ? curr : next).sprint?.stats.kps, summaries.reduce((curr, next) => (curr.sprint?.stats.kps??-1) > (next.sprint?.stats.kps??-1) ? curr : next).sprint?.stats.kps,
summaries.reduce((curr, next) => (curr.sprint?.stats.finessePercentage??-1) > (next.sprint?.stats.finessePercentage??-1) ? curr : next).sprint?.stats.finessePercentage,
summaries.reduce((curr, next) => (curr.sprint?.stats.finesse?.faults??-1) < (next.sprint?.stats.finesse?.faults??-1) ? curr : next).sprint?.stats.finesse?.faults,
null,
summaries.reduce((curr, next) => (curr.sprint?.stats.clears.quads??-1) > (next.sprint?.stats.clears.quads??-1) ? curr : next).sprint?.stats.clears.quads,
summaries.reduce((curr, next) => (curr.sprint?.stats.clears.triples??-1) > (next.sprint?.stats.clears.triples??-1) ? curr : next).sprint?.stats.clears.triples,
summaries.reduce((curr, next) => (curr.sprint?.stats.clears.doubles??-1) > (next.sprint?.stats.clears.doubles??-1) ? curr : next).sprint?.stats.clears.doubles,
summaries.reduce((curr, next) => (curr.sprint?.stats.clears.singles??-1) > (next.sprint?.stats.clears.singles??-1) ? curr : next).sprint?.stats.clears.singles,
null,
summaries.reduce((curr, next) => (curr.sprint?.stats.clears.tSpinTriples??-1) > (next.sprint?.stats.clears.tSpinTriples??-1) ? curr : next).sprint?.stats.clears.tSpinTriples,
summaries.reduce((curr, next) => (curr.sprint?.stats.clears.tSpinDoubles??-1) > (next.sprint?.stats.clears.tSpinDoubles??-1) ? curr : next).sprint?.stats.clears.tSpinDoubles,
summaries.reduce((curr, next) => (curr.sprint?.stats.clears.tSpinSingles??-1) > (next.sprint?.stats.clears.tSpinSingles??-1) ? curr : next).sprint?.stats.clears.tSpinSingles,
summaries.reduce((curr, next) => (curr.sprint?.stats.clears.tSpinZeros??-1) > (next.sprint?.stats.clears.tSpinZeros??-1) ? curr : next).sprint?.stats.clears.tSpinZeros,
summaries.reduce((curr, next) => (curr.sprint?.stats.clears.tSpinMiniDoubles??-1) > (next.sprint?.stats.clears.tSpinMiniDoubles??-1) ? curr : next).sprint?.stats.clears.tSpinMiniDoubles,
summaries.reduce((curr, next) => (curr.sprint?.stats.clears.tSpinMiniSingles??-1) > (next.sprint?.stats.clears.tSpinMiniSingles??-1) ? curr : next).sprint?.stats.clears.tSpinMiniSingles,
summaries.reduce((curr, next) => (curr.sprint?.stats.clears.tSpinMiniZeros??-1) > (next.sprint?.stats.clears.tSpinMiniZeros??-1) ? curr : next).sprint?.stats.clears.tSpinMiniZeros,
], ],
[ [
summaries.reduce((curr, next) => (curr.blitz?.stats.score??-1) > (next.blitz?.stats.score??-1) ? curr : next).blitz?.stats.score, summaries.reduce((curr, next) => (curr.blitz?.stats.score??-1) > (next.blitz?.stats.score??-1) ? curr : next).blitz?.stats.score,
summaries.reduce((curr, next) => (curr.blitz?.stats.piecesPlaced??-1) < (next.blitz?.stats.piecesPlaced??-1) ? curr : next).blitz?.stats.piecesPlaced, summaries.reduce((curr, next) => (curr.blitz?.stats.piecesPlaced??-1) < (next.blitz?.stats.piecesPlaced??-1) ? curr : next).blitz?.stats.piecesPlaced,
summaries.reduce((curr, next) => (curr.blitz?.stats.lines??-1) < (next.blitz?.stats.lines??-1) ? curr : next).blitz?.stats.lines,
summaries.reduce((curr, next) => (curr.blitz?.stats.level??-1) < (next.blitz?.stats.level??-1) ? curr : next).blitz?.stats.level,
summaries.reduce((curr, next) => (curr.blitz?.stats.inputs??-1) < (next.blitz?.stats.inputs??-1) ? curr : next).blitz?.stats.inputs, summaries.reduce((curr, next) => (curr.blitz?.stats.inputs??-1) < (next.blitz?.stats.inputs??-1) ? curr : next).blitz?.stats.inputs,
summaries.reduce((curr, next) => (curr.blitz?.stats.kpp??-1) < (next.blitz?.stats.kpp??-1) ? curr : next).blitz?.stats.kpp, summaries.reduce((curr, next) => (curr.blitz?.stats.kpp??-1) < (next.blitz?.stats.kpp??-1) ? curr : next).blitz?.stats.kpp,
summaries.reduce((curr, next) => (curr.blitz?.stats.pps??-1) > (next.blitz?.stats.pps??-1) ? curr : next).blitz?.stats.pps, summaries.reduce((curr, next) => (curr.blitz?.stats.pps??-1) > (next.blitz?.stats.pps??-1) ? curr : next).blitz?.stats.pps,
summaries.reduce((curr, next) => (curr.blitz?.stats.kps??-1) > (next.blitz?.stats.kps??-1) ? curr : next).blitz?.stats.kps, summaries.reduce((curr, next) => (curr.blitz?.stats.kps??-1) > (next.blitz?.stats.kps??-1) ? curr : next).blitz?.stats.kps,
summaries.reduce((curr, next) => (curr.blitz?.stats.finessePercentage??-1) > (next.blitz?.stats.finessePercentage??-1) ? curr : next).blitz?.stats.finessePercentage,
summaries.reduce((curr, next) => (curr.blitz?.stats.finesse?.faults??-1) < (next.blitz?.stats.finesse?.faults??-1) ? curr : next).blitz?.stats.finesse?.faults,
null,
summaries.reduce((curr, next) => (curr.blitz?.stats.clears.quads??-1) > (next.blitz?.stats.clears.quads??-1) ? curr : next).blitz?.stats.clears.quads,
summaries.reduce((curr, next) => (curr.blitz?.stats.clears.triples??-1) > (next.blitz?.stats.clears.triples??-1) ? curr : next).blitz?.stats.clears.triples,
summaries.reduce((curr, next) => (curr.blitz?.stats.clears.doubles??-1) > (next.blitz?.stats.clears.doubles??-1) ? curr : next).blitz?.stats.clears.doubles,
summaries.reduce((curr, next) => (curr.blitz?.stats.clears.singles??-1) > (next.blitz?.stats.clears.singles??-1) ? curr : next).blitz?.stats.clears.singles,
null,
summaries.reduce((curr, next) => (curr.blitz?.stats.clears.tSpinTriples??-1) > (next.blitz?.stats.clears.tSpinTriples??-1) ? curr : next).blitz?.stats.clears.tSpinTriples,
summaries.reduce((curr, next) => (curr.blitz?.stats.clears.tSpinDoubles??-1) > (next.blitz?.stats.clears.tSpinDoubles??-1) ? curr : next).blitz?.stats.clears.tSpinDoubles,
summaries.reduce((curr, next) => (curr.blitz?.stats.clears.tSpinSingles??-1) > (next.blitz?.stats.clears.tSpinSingles??-1) ? curr : next).blitz?.stats.clears.tSpinSingles,
summaries.reduce((curr, next) => (curr.blitz?.stats.clears.tSpinZeros??-1) > (next.blitz?.stats.clears.tSpinZeros??-1) ? curr : next).blitz?.stats.clears.tSpinZeros,
summaries.reduce((curr, next) => (curr.blitz?.stats.clears.tSpinMiniDoubles??-1) > (next.blitz?.stats.clears.tSpinMiniDoubles??-1) ? curr : next).blitz?.stats.clears.tSpinMiniDoubles,
summaries.reduce((curr, next) => (curr.blitz?.stats.clears.tSpinMiniSingles??-1) > (next.blitz?.stats.clears.tSpinMiniSingles??-1) ? curr : next).blitz?.stats.clears.tSpinMiniSingles,
summaries.reduce((curr, next) => (curr.blitz?.stats.clears.tSpinMiniZeros??-1) > (next.blitz?.stats.clears.tSpinMiniZeros??-1) ? curr : next).blitz?.stats.clears.tSpinMiniZeros,
], ],
[ [
summaries.reduce((curr, next) => curr.zen.score > next.zen.score ? curr : next).zen.score, summaries.reduce((curr, next) => curr.zen.score > next.zen.score ? curr : next).zen.score,

View File

@ -44,6 +44,8 @@ class _DestinationGraphsState extends State<DestinationGraphs> {
Stats _Ychart = Stats.tr; Stats _Ychart = Stats.tr;
Stats _Xchart = Stats.tr; Stats _Xchart = Stats.tr;
int _season = currentSeason-1; int _season = currentSeason-1;
ValueNotifier<String> historyPlayerUsername = ValueNotifier("");
ValueNotifier<String> historyPlayerAvatarRevizion = ValueNotifier("");
List<String> excludeRanks = []; List<String> excludeRanks = [];
late Future<List<_MyScatterSpot>> futureLeague = getTetraLeagueData(_Xchart, _Ychart); late Future<List<_MyScatterSpot>> futureLeague = getTetraLeagueData(_Xchart, _Ychart);
String searchLeague = ""; String searchLeague = "";
@ -177,7 +179,7 @@ class _DestinationGraphsState extends State<DestinationGraphs> {
entry.userId, entry.userId,
entry.username, entry.username,
entry.rank, entry.rank,
(rankColors[entry.rank]??Colors.white).withAlpha((searchLeague.isNotEmpty && entry.username.startsWith(searchLeague.toLowerCase())) ? 255 : 20) (rankColors[entry.rank]??Colors.white).withOpacity((searchLeague.isEmpty || entry.username.startsWith(searchLeague.toLowerCase())) ? 1.0 : 0.005)
) )
]; ];
return _spots; return _spots;
@ -274,6 +276,10 @@ class _DestinationGraphsState extends State<DestinationGraphs> {
dataSource: snapshot.data, dataSource: snapshot.data,
animationDuration: 0, animationDuration: 0,
pointColorMapper: (data, _) => data.color, pointColorMapper: (data, _) => data.color,
markerSettings: MarkerSettings(
isVisible: false,
borderColor: Colors.black,
),
xValueMapper: (data, _) => data.x, xValueMapper: (data, _) => data.x,
yValueMapper: (data, _) => data.y, yValueMapper: (data, _) => data.y,
onPointTap: (point) => Navigator.push(context, MaterialPageRoute(builder: (context) => MainView(player: snapshot.data![point.pointIndex!].nickname), maintainState: false)), onPointTap: (point) => Navigator.push(context, MaterialPageRoute(builder: (context) => MainView(player: snapshot.data![point.pointIndex!].nickname), maintainState: false)),
@ -348,11 +354,28 @@ class _DestinationGraphsState extends State<DestinationGraphs> {
spacing: 20, spacing: 20,
crossAxisAlignment: WrapCrossAlignment.center, crossAxisAlignment: WrapCrossAlignment.center,
children: [ children: [
if (_graph == Graph.history) Row(
mainAxisSize: MainAxisSize.min,
children: [
Icon(Icons.person),
Padding(
padding: EdgeInsets.all(8.0),
child: ValueListenableBuilder<String>(
valueListenable: historyPlayerUsername,
builder: (context, value, child) {
return Text(value, style: TextStyle(fontSize: 22, fontFamily: "Eurostile Round Extended"));
},
)
),
],
),
if (_graph == Graph.leagueState) SizedBox( if (_graph == Graph.leagueState) SizedBox(
width: 300, width: 300,
child: TextField( child: TextField(
style: TextStyle(fontSize: 18.0000),
decoration: InputDecoration( decoration: InputDecoration(
icon: Icon(Icons.search) icon: Icon(Icons.search),
isDense: true
), ),
onChanged: (v){ onChanged: (v){
searchLeague = v; searchLeague = v;
@ -414,7 +437,7 @@ class _DestinationGraphsState extends State<DestinationGraphs> {
), ),
], ],
), ),
if (_graph != Graph.leagueState) Row( if (_graph == Graph.history) Row(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: [ children: [
Checkbox(value: _smooth, Checkbox(value: _smooth,

View File

@ -233,31 +233,29 @@ class _RankState extends State<RankView> {
SizedBox( SizedBox(
width: constraints.maxWidth - 350, width: constraints.maxWidth - 350,
height: constraints.maxHeight, height: constraints.maxHeight,
child: Column( child: Row(
children: [ children: [
SegmentedButton<CardMod>( SizedBox(
showSelectedIcon: false, width: 200.0,
selected: <CardMod>{cardMod}, child: Card(
segments: <ButtonSegment<CardMod>>[ child: Column(
ButtonSegment<CardMod>( children: [],
value: CardMod.graph,
label: Text("Graph"),
), ),
ButtonSegment<CardMod>( ),
value: CardMod.graph, ),
label: Text("Minimums"), Expanded(
child: Card(
child: Column(
children: [],
), ),
ButtonSegment<CardMod>( ),
value: CardMod.graph, ),
label: Text("Maximums"), Expanded(
) child: Card(
], child: Column(
onSelectionChanged: (p0) { children: [],
setState(() { ),
cardMod = p0.first; ),
//_transition.;
});
},
) )
], ],
), ),