2024-06-16 21:04:07 +00:00
|
|
|
// ignore_for_file: use_build_context_synchronously
|
|
|
|
|
2023-10-09 18:48:50 +00:00
|
|
|
import 'dart:io';
|
2023-06-17 21:50:52 +00:00
|
|
|
import 'dart:math';
|
2023-07-06 12:48:04 +00:00
|
|
|
import 'package:flutter/foundation.dart';
|
2023-06-17 21:50:52 +00:00
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:intl/intl.dart';
|
2024-09-05 21:42:21 +00:00
|
|
|
import 'package:tetra_stats/data_objects/summaries.dart';
|
|
|
|
import 'package:tetra_stats/data_objects/tetra_league.dart';
|
|
|
|
import 'package:tetra_stats/data_objects/tetrio_constants.dart';
|
|
|
|
import 'package:tetra_stats/data_objects/tetrio_zen.dart';
|
2023-07-14 20:21:49 +00:00
|
|
|
import 'package:tetra_stats/gen/strings.g.dart';
|
2024-06-03 23:42:44 +00:00
|
|
|
import 'package:tetra_stats/main.dart' show teto;
|
2024-08-20 17:17:59 +00:00
|
|
|
import 'package:tetra_stats/utils/relative_timestamps.dart';
|
2023-10-26 22:38:03 +00:00
|
|
|
import 'package:tetra_stats/widgets/vs_graphs.dart';
|
2023-10-09 18:48:50 +00:00
|
|
|
import 'package:window_manager/window_manager.dart';
|
2023-06-17 21:50:52 +00:00
|
|
|
|
2023-07-06 12:48:04 +00:00
|
|
|
enum Mode{
|
|
|
|
player,
|
|
|
|
stats,
|
|
|
|
averages
|
|
|
|
}
|
|
|
|
Mode greenSideMode = Mode.player;
|
2024-08-20 17:17:59 +00:00
|
|
|
List<dynamic> theGreenSide = [null, null, null]; // TetrioPlayer?, List<DropdownMenuItem<TetrioPlayer>>?, Summary
|
2023-07-06 12:48:04 +00:00
|
|
|
Mode redSideMode = Mode.player;
|
|
|
|
List<dynamic> theRedSide = [null, null, null];
|
2023-07-14 20:21:49 +00:00
|
|
|
final DateFormat dateFormat = DateFormat.yMd(LocaleSettings.currentLocale.languageCode).add_Hm();
|
2023-07-06 12:48:04 +00:00
|
|
|
var numbersReg = RegExp(r'\d+(\.\d*)*');
|
2023-10-09 18:48:50 +00:00
|
|
|
late String oldWindowTitle;
|
2023-06-17 21:50:52 +00:00
|
|
|
|
|
|
|
class CompareView extends StatefulWidget {
|
2023-07-06 12:48:04 +00:00
|
|
|
final List<dynamic> greenSide;
|
|
|
|
final List<dynamic> redSide;
|
|
|
|
final Mode greenMode;
|
|
|
|
final Mode redMode;
|
2024-01-13 18:49:36 +00:00
|
|
|
const CompareView({super.key, required this.greenSide, required this.redSide, required this.greenMode, required this.redMode});
|
2023-06-17 21:50:52 +00:00
|
|
|
|
|
|
|
@override
|
|
|
|
State<StatefulWidget> createState() => CompareState();
|
|
|
|
}
|
|
|
|
|
|
|
|
class CompareState extends State<CompareView> {
|
|
|
|
late ScrollController _scrollController;
|
|
|
|
|
|
|
|
@override
|
|
|
|
void initState() {
|
|
|
|
theGreenSide = widget.greenSide;
|
2023-07-06 12:48:04 +00:00
|
|
|
fetchGreenSide(widget.greenSide[0].userId);
|
|
|
|
if (widget.redSide[0] != null) fetchRedSide(widget.redSide[0].userId);
|
2023-06-17 21:50:52 +00:00
|
|
|
_scrollController = ScrollController();
|
2023-10-10 20:20:27 +00:00
|
|
|
if (!kIsWeb && !Platform.isAndroid && !Platform.isIOS){
|
2023-10-09 18:48:50 +00:00
|
|
|
windowManager.getTitle().then((value) => oldWindowTitle = value);
|
|
|
|
}
|
2023-06-17 21:50:52 +00:00
|
|
|
super.initState();
|
|
|
|
}
|
|
|
|
|
2023-06-19 20:42:37 +00:00
|
|
|
@override
|
|
|
|
void dispose(){
|
2023-07-06 12:48:04 +00:00
|
|
|
theGreenSide = [null, null, null];
|
2023-07-06 13:26:20 +00:00
|
|
|
greenSideMode = Mode.player;
|
2023-07-06 12:48:04 +00:00
|
|
|
theRedSide = [null, null, null];
|
2023-07-06 13:26:20 +00:00
|
|
|
redSideMode = Mode.player;
|
2023-10-10 20:20:27 +00:00
|
|
|
if (!kIsWeb && !Platform.isAndroid && !Platform.isIOS) windowManager.setTitle(oldWindowTitle);
|
2023-06-19 20:42:37 +00:00
|
|
|
super.dispose();
|
|
|
|
}
|
|
|
|
|
2023-06-17 21:50:52 +00:00
|
|
|
void fetchRedSide(String user) async {
|
|
|
|
try {
|
2023-07-10 17:42:20 +00:00
|
|
|
if (user.startsWith("\$avg")){
|
|
|
|
try{
|
2024-11-01 00:05:26 +00:00
|
|
|
//var average = (await teto.fetchTLLeaderboard()).getAverageOfRank(user.substring(4).toLowerCase())[0];
|
|
|
|
//Summaries summary = Summaries("avg${user.substring(4).toLowerCase()}", average, TetrioZen(level: 0, score: 0));
|
2023-07-10 17:42:20 +00:00
|
|
|
redSideMode = Mode.averages;
|
2024-11-01 00:05:26 +00:00
|
|
|
//theRedSide = [null, null, summary];
|
2023-07-10 17:42:20 +00:00
|
|
|
return setState(() {});
|
|
|
|
}on Exception {
|
2024-02-03 13:02:58 +00:00
|
|
|
if (context.mounted) ScaffoldMessenger.of(context).showSnackBar(SnackBar(content: Text(t.compareViewWrongValue(value: user))));
|
2023-07-10 17:42:20 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
2023-07-06 12:48:04 +00:00
|
|
|
var tearDownToNumbers = numbersReg.allMatches(user);
|
|
|
|
if (tearDownToNumbers.length == 3) {
|
|
|
|
redSideMode = Mode.stats;
|
|
|
|
var threeNumbers = tearDownToNumbers.toList();
|
|
|
|
double apm = double.parse(threeNumbers[0][0]!);
|
|
|
|
double pps = double.parse(threeNumbers[1][0]!);
|
|
|
|
double vs = double.parse(threeNumbers[2][0]!);
|
|
|
|
theRedSide = [null,
|
|
|
|
null,
|
2024-08-20 17:17:59 +00:00
|
|
|
Summaries(user, TetraLeague(
|
2024-09-01 21:44:19 +00:00
|
|
|
id: "",
|
2023-07-17 17:57:24 +00:00
|
|
|
timestamp: DateTime.now(),
|
2023-07-06 12:48:04 +00:00
|
|
|
apm: apm,
|
|
|
|
pps: pps,
|
|
|
|
vs: vs,
|
|
|
|
rd: noTrRd,
|
|
|
|
gamesPlayed: -1,
|
|
|
|
gamesWon: -1,
|
|
|
|
bestRank: "z",
|
|
|
|
decaying: true,
|
2024-08-16 22:40:09 +00:00
|
|
|
tr: -1,
|
|
|
|
gxe: -1,
|
2023-07-06 12:48:04 +00:00
|
|
|
rank: "z",
|
|
|
|
percentileRank: "z",
|
|
|
|
percentile: 1,
|
|
|
|
standing: -1,
|
|
|
|
standingLocal: -1,
|
|
|
|
nextAt: -1,
|
2024-09-01 21:44:19 +00:00
|
|
|
prevAt: -1, season: currentSeason), TetrioZen(level: 0, score: 0))];
|
2023-07-06 12:48:04 +00:00
|
|
|
return setState(() {});
|
|
|
|
}
|
|
|
|
var player = await teto.fetchPlayer(user);
|
2024-08-20 17:17:59 +00:00
|
|
|
Summaries summary = await teto.fetchSummaries(player.userId);
|
2023-07-06 12:48:04 +00:00
|
|
|
redSideMode = Mode.player;
|
2024-08-20 17:17:59 +00:00
|
|
|
//late List<TetrioPlayer> states;
|
|
|
|
// List<DropdownMenuItem<TetrioPlayer>>? dStates = <DropdownMenuItem<TetrioPlayer>>[];
|
|
|
|
// try{
|
|
|
|
// states = await teto.getPlayer(player.userId);
|
|
|
|
// for (final TetrioPlayer state in states) {
|
|
|
|
// dStates.add(DropdownMenuItem<TetrioPlayer>(
|
|
|
|
// value: state, child: Text(dateFormat.format(state.state))));
|
|
|
|
// }
|
|
|
|
// dStates.firstWhere((element) => element.value == player, orElse: () {
|
|
|
|
// dStates?.add(DropdownMenuItem<TetrioPlayer>(
|
|
|
|
// value: player, child: Text(t.mostRecentOne)));
|
|
|
|
// return DropdownMenuItem<TetrioPlayer>(
|
|
|
|
// value: player, child: Text(t.mostRecentOne));
|
|
|
|
// },);
|
|
|
|
// }on Exception {
|
|
|
|
// dStates = null;
|
|
|
|
// }
|
|
|
|
theRedSide = [player, null, summary];
|
2023-06-17 21:50:52 +00:00
|
|
|
} on Exception {
|
2024-02-03 13:02:58 +00:00
|
|
|
if (context.mounted) ScaffoldMessenger.of(context).showSnackBar(SnackBar(content: Text(t.compareViewWrongValue(value: user))));
|
2023-06-17 21:50:52 +00:00
|
|
|
}
|
2023-07-11 20:51:53 +00:00
|
|
|
_justUpdate();
|
2023-06-17 21:50:52 +00:00
|
|
|
}
|
|
|
|
|
2024-09-01 21:44:19 +00:00
|
|
|
void changeRedSide(TetraLeague user) {
|
|
|
|
setState(() {
|
|
|
|
//theRedSide[0] = user;
|
|
|
|
theRedSide[2].league = user;
|
|
|
|
});
|
2023-06-19 20:42:37 +00:00
|
|
|
}
|
|
|
|
|
2023-06-17 21:50:52 +00:00
|
|
|
void fetchGreenSide(String user) async {
|
|
|
|
try {
|
2023-07-10 17:42:20 +00:00
|
|
|
if (user.startsWith("\$avg")){
|
|
|
|
try{
|
2024-11-01 00:05:26 +00:00
|
|
|
//var average = (await teto.fetchTLLeaderboard()).getAverageOfRank(user.substring(4).toLowerCase())[0];
|
|
|
|
//Summaries summary = Summaries("avg${user.substring(4).toLowerCase()}", average, TetrioZen(level: 0, score: 0));
|
2023-07-10 17:42:20 +00:00
|
|
|
greenSideMode = Mode.averages;
|
2024-11-01 00:05:26 +00:00
|
|
|
//theGreenSide = [null, null, summary];
|
2023-07-10 17:42:20 +00:00
|
|
|
return setState(() {});
|
|
|
|
}on Exception {
|
2024-02-03 13:02:58 +00:00
|
|
|
if (context.mounted) ScaffoldMessenger.of(context).showSnackBar(SnackBar(content: Text("Falied to assign $user")));
|
2023-07-10 17:42:20 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
2023-07-06 12:48:04 +00:00
|
|
|
var tearDownToNumbers = numbersReg.allMatches(user);
|
|
|
|
if (tearDownToNumbers.length == 3) {
|
|
|
|
greenSideMode = Mode.stats;
|
|
|
|
var threeNumbers = tearDownToNumbers.toList();
|
|
|
|
double apm = double.parse(threeNumbers[0][0]!);
|
|
|
|
double pps = double.parse(threeNumbers[1][0]!);
|
|
|
|
double vs = double.parse(threeNumbers[2][0]!);
|
2023-07-06 13:26:20 +00:00
|
|
|
theGreenSide = [null,
|
2023-07-06 12:48:04 +00:00
|
|
|
null,
|
2024-08-20 17:17:59 +00:00
|
|
|
Summaries(user, TetraLeague(
|
2024-09-01 21:44:19 +00:00
|
|
|
id: "",
|
2023-07-17 17:57:24 +00:00
|
|
|
timestamp: DateTime.now(),
|
2023-07-06 12:48:04 +00:00
|
|
|
apm: apm,
|
|
|
|
pps: pps,
|
|
|
|
vs: vs,
|
|
|
|
rd: noTrRd,
|
|
|
|
gamesPlayed: -1,
|
|
|
|
gamesWon: -1,
|
|
|
|
bestRank: "z",
|
|
|
|
decaying: true,
|
2024-08-16 22:40:09 +00:00
|
|
|
tr: -1,
|
|
|
|
gxe: -1,
|
2023-07-06 12:48:04 +00:00
|
|
|
rank: "z",
|
|
|
|
percentileRank: "z",
|
|
|
|
percentile: 1,
|
|
|
|
standing: -1,
|
|
|
|
standingLocal: -1,
|
|
|
|
nextAt: -1,
|
2024-09-01 21:44:19 +00:00
|
|
|
prevAt: -1, season: currentSeason), TetrioZen(level: 0, score: 0))];
|
2023-07-06 12:48:04 +00:00
|
|
|
return setState(() {});
|
|
|
|
}
|
|
|
|
var player = await teto.fetchPlayer(user);
|
2024-08-20 17:17:59 +00:00
|
|
|
Summaries summary = await teto.fetchSummaries(player.userId);
|
2023-07-06 12:48:04 +00:00
|
|
|
greenSideMode = Mode.player;
|
2024-08-20 17:17:59 +00:00
|
|
|
// late List<TetrioPlayer> states;
|
|
|
|
// List<DropdownMenuItem<TetrioPlayer>>? dStates = <DropdownMenuItem<TetrioPlayer>>[];
|
|
|
|
// try{
|
|
|
|
// states = await teto.getPlayer(player.userId);
|
|
|
|
// for (final TetrioPlayer state in states) {
|
|
|
|
// dStates.add(DropdownMenuItem<TetrioPlayer>(
|
|
|
|
// value: state, child: Text(dateFormat.format(state.state))));
|
|
|
|
// }
|
|
|
|
// dStates.firstWhere((element) => element.value == player, orElse: () {
|
|
|
|
// dStates?.add(DropdownMenuItem<TetrioPlayer>(
|
|
|
|
// value: player, child: Text(t.mostRecentOne)));
|
|
|
|
// return DropdownMenuItem<TetrioPlayer>(
|
|
|
|
// value: player, child: Text(t.mostRecentOne));
|
|
|
|
// },);
|
|
|
|
// }on Exception {
|
|
|
|
// dStates = null;
|
|
|
|
// }
|
|
|
|
theGreenSide = [player, null, summary];
|
2023-06-17 21:50:52 +00:00
|
|
|
} on Exception {
|
2024-02-03 13:02:58 +00:00
|
|
|
if (context.mounted) ScaffoldMessenger.of(context).showSnackBar(SnackBar(content: Text("Falied to assign $user")));
|
2023-06-17 21:50:52 +00:00
|
|
|
}
|
2023-07-11 20:51:53 +00:00
|
|
|
_justUpdate();
|
2023-06-17 21:50:52 +00:00
|
|
|
}
|
|
|
|
|
2024-09-01 21:44:19 +00:00
|
|
|
void changeGreenSide(TetraLeague user) {
|
|
|
|
setState(() {
|
|
|
|
//theGreenSide[0] = user;
|
|
|
|
theGreenSide[2].league = user;
|
|
|
|
});
|
2023-06-19 20:42:37 +00:00
|
|
|
}
|
|
|
|
|
2024-02-03 13:02:58 +00:00
|
|
|
double getWinrateByTR(double yourGlicko, double yourRD, double notyourGlicko,double notyourRD) {
|
2023-06-17 21:50:52 +00:00
|
|
|
return ((1 /
|
2024-02-03 13:02:58 +00:00
|
|
|
(1 + pow(10,
|
|
|
|
(notyourGlicko - yourGlicko) /
|
|
|
|
(400 * sqrt(1 + (3 * pow(0.0057564273, 2) *
|
|
|
|
(pow(yourRD, 2) + pow(notyourRD, 2)) / pow(pi, 2)
|
|
|
|
)))
|
|
|
|
)
|
|
|
|
)
|
|
|
|
));
|
2023-06-17 21:50:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void _justUpdate() {
|
|
|
|
setState(() {});
|
|
|
|
}
|
|
|
|
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
2023-07-14 20:21:49 +00:00
|
|
|
final t = Translations.of(context);
|
2023-06-17 21:50:52 +00:00
|
|
|
bool bigScreen = MediaQuery.of(context).size.width > 768;
|
2023-07-06 12:48:04 +00:00
|
|
|
String titleGreenSide;
|
|
|
|
String titleRedSide;
|
|
|
|
switch (greenSideMode){
|
|
|
|
case Mode.player:
|
|
|
|
titleGreenSide = theGreenSide[0] != null ? theGreenSide[0].username.toUpperCase() : "???";
|
|
|
|
break;
|
|
|
|
case Mode.stats:
|
2024-08-20 17:17:59 +00:00
|
|
|
titleGreenSide = "${theGreenSide[2].league.apm} APM, ${theGreenSide[2].league.pps} PPS, ${theGreenSide[2].league.vs} VS";
|
2023-07-06 12:48:04 +00:00
|
|
|
break;
|
|
|
|
case Mode.averages:
|
2024-08-20 17:17:59 +00:00
|
|
|
titleGreenSide = t.averageXrank(rankLetter: theGreenSide[2].league.rank.toUpperCase());
|
2023-07-06 12:48:04 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
switch (redSideMode){
|
|
|
|
case Mode.player:
|
|
|
|
titleRedSide = theRedSide[0] != null ? theRedSide[0].username.toUpperCase() : "???";
|
|
|
|
break;
|
|
|
|
case Mode.stats:
|
2024-08-20 17:17:59 +00:00
|
|
|
titleRedSide = "${theRedSide[2].league.apm} APM, ${theRedSide[2].league.pps} PPS, ${theRedSide[2].league.vs} VS";
|
2023-07-06 12:48:04 +00:00
|
|
|
break;
|
|
|
|
case Mode.averages:
|
2024-08-20 17:17:59 +00:00
|
|
|
titleRedSide = t.averageXrank(rankLetter: theRedSide[2].league.rank.toUpperCase());
|
2023-07-06 12:48:04 +00:00
|
|
|
break;
|
|
|
|
}
|
2023-10-09 18:48:50 +00:00
|
|
|
windowManager.setTitle("Tetra Stats: $titleGreenSide ${t.vs} $titleRedSide");
|
2023-06-17 21:50:52 +00:00
|
|
|
return Scaffold(
|
2023-07-14 20:21:49 +00:00
|
|
|
appBar: AppBar(title: Text("$titleGreenSide ${t.vs} $titleRedSide")),
|
2023-06-17 21:50:52 +00:00
|
|
|
backgroundColor: Colors.black,
|
2024-03-24 16:38:06 +00:00
|
|
|
body: SingleChildScrollView(
|
|
|
|
controller: _scrollController,
|
2024-05-04 20:04:48 +00:00
|
|
|
physics: const AlwaysScrollableScrollPhysics(),
|
2024-03-02 22:26:31 +00:00
|
|
|
child: Center(
|
|
|
|
child: Container(
|
2024-03-20 22:56:13 +00:00
|
|
|
constraints: const BoxConstraints(maxWidth: 768),
|
2024-03-24 16:38:06 +00:00
|
|
|
child: Column(children: [
|
|
|
|
Padding(
|
|
|
|
padding: const EdgeInsets.fromLTRB(16, 16, 16, 32),
|
|
|
|
child: Row(
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
children: [
|
|
|
|
Expanded(
|
|
|
|
child: Container(
|
|
|
|
decoration: const BoxDecoration(
|
|
|
|
gradient: LinearGradient(
|
|
|
|
colors: [Colors.green, Colors.transparent],
|
|
|
|
begin: Alignment.bottomCenter,
|
|
|
|
end: Alignment.topCenter,
|
|
|
|
stops: [0.0, 0.4],
|
|
|
|
)),
|
|
|
|
child: Padding(
|
|
|
|
padding: const EdgeInsets.fromLTRB(8, 0, 8, 0),
|
|
|
|
child: PlayerSelector(
|
|
|
|
data: theGreenSide,
|
|
|
|
mode: greenSideMode,
|
|
|
|
fetch: fetchGreenSide,
|
|
|
|
change: changeGreenSide,
|
|
|
|
updateState: _justUpdate,
|
2023-06-17 21:50:52 +00:00
|
|
|
),
|
2024-03-24 16:38:06 +00:00
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
const Padding(
|
|
|
|
padding: EdgeInsets.only(top: 16),
|
|
|
|
child: Text("VS"),
|
|
|
|
),
|
|
|
|
Expanded(
|
|
|
|
child: Container(
|
|
|
|
decoration: const BoxDecoration(
|
|
|
|
gradient: LinearGradient(
|
|
|
|
colors: [Colors.red, Colors.transparent],
|
|
|
|
begin: Alignment.bottomCenter,
|
|
|
|
end: Alignment.topCenter,
|
|
|
|
stops: [0.0, 0.4],
|
|
|
|
)),
|
|
|
|
child: Padding(
|
|
|
|
padding: const EdgeInsets.fromLTRB(8, 0, 8, 0),
|
|
|
|
child: PlayerSelector(
|
|
|
|
data: theRedSide,
|
|
|
|
mode: redSideMode,
|
|
|
|
fetch: fetchRedSide,
|
|
|
|
change: changeRedSide,
|
|
|
|
updateState: _justUpdate,
|
2023-06-17 21:50:52 +00:00
|
|
|
),
|
2024-03-24 16:38:06 +00:00
|
|
|
),
|
2023-07-06 12:48:04 +00:00
|
|
|
),
|
2024-03-02 22:26:31 +00:00
|
|
|
),
|
2024-03-24 16:38:06 +00:00
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
2024-05-04 20:04:48 +00:00
|
|
|
const Divider(),
|
2024-03-24 16:38:06 +00:00
|
|
|
if (!listEquals(theGreenSide, [null, null, null]) && !listEquals(theRedSide, [null, null, null])) Column(
|
|
|
|
children: [
|
|
|
|
if (theGreenSide[0] != null && theRedSide[0] != null && theGreenSide[0]!.role != "banned" && theRedSide[0]!.role != "banned")
|
|
|
|
Column(
|
|
|
|
children: [
|
|
|
|
CompareRegTimeThingy(
|
|
|
|
greenSide: theGreenSide[0].registrationTime,
|
|
|
|
redSide: theRedSide[0].registrationTime,
|
|
|
|
label: t.registred),
|
|
|
|
CompareThingy(
|
|
|
|
label: t.statCellNum.level,
|
|
|
|
greenSide: theGreenSide[0].level,
|
|
|
|
redSide: theRedSide[0].level,
|
|
|
|
higherIsBetter: true,
|
|
|
|
fractionDigits: 2,
|
|
|
|
),
|
|
|
|
if (!theGreenSide[0].gameTime.isNegative && !theRedSide[0].gameTime.isNegative)
|
|
|
|
CompareThingy(
|
|
|
|
greenSide: theGreenSide[0].gameTime.inMicroseconds /
|
|
|
|
1000000 /
|
|
|
|
60 /
|
|
|
|
60,
|
|
|
|
redSide: theRedSide[0].gameTime.inMicroseconds /
|
|
|
|
1000000 /
|
|
|
|
60 /
|
|
|
|
60,
|
|
|
|
label: t.statCellNum.hoursPlayed.replaceAll(RegExp(r'\n'), " "),
|
|
|
|
higherIsBetter: true,
|
|
|
|
fractionDigits: 2,
|
|
|
|
),
|
|
|
|
if (theGreenSide[0].gamesPlayed >= 0 && theRedSide[0].gamesPlayed >= 0)
|
|
|
|
CompareThingy(
|
|
|
|
label: t.statCellNum.onlineGames.replaceAll(RegExp(r'\n'), " "),
|
|
|
|
greenSide: theGreenSide[0].gamesPlayed,
|
|
|
|
redSide: theRedSide[0].gamesPlayed,
|
|
|
|
higherIsBetter: true,
|
|
|
|
),
|
|
|
|
if (theGreenSide[0].gamesWon >= 0 && theRedSide[0].gamesWon >= 0)
|
|
|
|
CompareThingy(
|
|
|
|
label: t.statCellNum.gamesWon.replaceAll(RegExp(r'\n'), " "),
|
|
|
|
greenSide: theGreenSide[0].gamesWon,
|
|
|
|
redSide: theRedSide[0].gamesWon,
|
|
|
|
higherIsBetter: true,
|
|
|
|
),
|
|
|
|
CompareThingy(
|
|
|
|
label: t.statCellNum.friends,
|
|
|
|
greenSide: theGreenSide[0].friendCount,
|
|
|
|
redSide: theRedSide[0].friendCount,
|
|
|
|
higherIsBetter: true,
|
|
|
|
),
|
|
|
|
const Divider(),
|
|
|
|
],
|
2024-03-02 22:26:31 +00:00
|
|
|
),
|
2024-03-24 16:38:06 +00:00
|
|
|
if (theGreenSide[0] != null && theRedSide[0] != null && (theGreenSide[0]!.role == "banned" || theRedSide[0]!.role == "banned"))
|
|
|
|
CompareBoolThingy(
|
|
|
|
greenSide: theGreenSide[0].role == "banned",
|
|
|
|
redSide: theRedSide[0].role == "banned",
|
|
|
|
label: t.normalBanned,
|
|
|
|
trueIsBetter: false
|
|
|
|
),
|
2024-08-20 17:17:59 +00:00
|
|
|
(theGreenSide[2].league.gamesPlayed > 0 || greenSideMode == Mode.stats) && (theRedSide[2].league.gamesPlayed > 0 || redSideMode == Mode.stats)
|
2024-03-24 16:38:06 +00:00
|
|
|
? Column(
|
|
|
|
children: [
|
|
|
|
Padding(
|
|
|
|
padding: const EdgeInsets.only(bottom: 16),
|
|
|
|
child: Text(t.tetraLeague,
|
|
|
|
style: TextStyle(
|
|
|
|
fontFamily: "Eurostile Round Extended",
|
|
|
|
fontSize: bigScreen ? 42 : 28)),
|
2024-03-02 22:26:31 +00:00
|
|
|
),
|
2024-08-20 17:17:59 +00:00
|
|
|
if (theGreenSide[2].league.gamesPlayed > 9 &&
|
|
|
|
theRedSide[2].league.gamesPlayed > 9 &&
|
2024-03-24 16:38:06 +00:00
|
|
|
greenSideMode != Mode.stats &&
|
|
|
|
redSideMode != Mode.stats)
|
|
|
|
CompareThingy(
|
|
|
|
label: "TR",
|
2024-08-20 17:17:59 +00:00
|
|
|
greenSide: theGreenSide[2].league.tr,
|
|
|
|
redSide: theRedSide[2].league.tr,
|
2024-03-24 16:38:06 +00:00
|
|
|
fractionDigits: 2,
|
|
|
|
higherIsBetter: true,
|
|
|
|
),
|
|
|
|
if (greenSideMode != Mode.stats &&
|
|
|
|
redSideMode != Mode.stats)
|
|
|
|
CompareThingy(
|
|
|
|
label: t.statCellNum.gamesPlayed.replaceAll(RegExp(r'\n'), " "),
|
2024-08-20 17:17:59 +00:00
|
|
|
greenSide: theGreenSide[2].league.gamesPlayed,
|
|
|
|
redSide: theRedSide[2].league.gamesPlayed,
|
2024-03-24 16:38:06 +00:00
|
|
|
higherIsBetter: true,
|
|
|
|
),
|
|
|
|
if (greenSideMode != Mode.stats &&
|
|
|
|
redSideMode != Mode.stats)
|
|
|
|
CompareThingy(
|
|
|
|
label: t.statCellNum.gamesWonTL.replaceAll(RegExp(r'\n'), " "),
|
2024-08-20 17:17:59 +00:00
|
|
|
greenSide: theGreenSide[2].league.gamesWon,
|
|
|
|
redSide: theRedSide[2].league.gamesWon,
|
2024-03-24 16:38:06 +00:00
|
|
|
higherIsBetter: true,
|
|
|
|
),
|
|
|
|
if (greenSideMode != Mode.stats &&
|
|
|
|
redSideMode != Mode.stats)
|
|
|
|
CompareThingy(
|
|
|
|
label: "WR %",
|
|
|
|
greenSide:
|
2024-08-20 17:17:59 +00:00
|
|
|
theGreenSide[2].league.winrate * 100,
|
|
|
|
redSide: theRedSide[2].league.winrate * 100,
|
2024-03-24 16:38:06 +00:00
|
|
|
fractionDigits: 2,
|
|
|
|
higherIsBetter: true,
|
|
|
|
),
|
2024-08-20 17:17:59 +00:00
|
|
|
if (theGreenSide[2].league.gamesPlayed > 9 &&
|
|
|
|
theRedSide[2].league.gamesPlayed > 9 &&
|
2024-03-24 16:38:06 +00:00
|
|
|
greenSideMode != Mode.stats &&
|
|
|
|
redSideMode != Mode.stats)
|
|
|
|
CompareThingy(
|
|
|
|
label: "Glicko",
|
2024-08-20 17:17:59 +00:00
|
|
|
greenSide: theGreenSide[2].league.glicko!,
|
|
|
|
redSide: theRedSide[2].league.glicko!,
|
2024-03-24 16:38:06 +00:00
|
|
|
fractionDigits: 2,
|
|
|
|
higherIsBetter: true,
|
|
|
|
),
|
2024-08-20 17:17:59 +00:00
|
|
|
if (theGreenSide[2].league.gamesPlayed > 9 &&
|
|
|
|
theRedSide[2].league.gamesPlayed > 9 &&
|
2024-03-24 16:38:06 +00:00
|
|
|
greenSideMode != Mode.stats &&
|
|
|
|
redSideMode != Mode.stats)
|
|
|
|
CompareThingy(
|
|
|
|
label: "RD",
|
2024-08-20 17:17:59 +00:00
|
|
|
greenSide: theGreenSide[2].league.rd!,
|
|
|
|
redSide: theRedSide[2].league.rd!,
|
2024-03-24 16:38:06 +00:00
|
|
|
fractionDigits: 3,
|
|
|
|
higherIsBetter: false,
|
|
|
|
),
|
2024-08-20 17:17:59 +00:00
|
|
|
if (theGreenSide[2].league.standing > 0 &&
|
|
|
|
theRedSide[2].league.standing > 0 &&
|
2024-03-24 16:38:06 +00:00
|
|
|
greenSideMode == Mode.player &&
|
|
|
|
redSideMode == Mode.player)
|
|
|
|
CompareThingy(
|
|
|
|
label: t.statCellNum.lbpShort,
|
2024-08-20 17:17:59 +00:00
|
|
|
greenSide: theGreenSide[2].league.standing,
|
|
|
|
redSide: theRedSide[2].league.standing,
|
2024-03-24 16:38:06 +00:00
|
|
|
higherIsBetter: false,
|
|
|
|
),
|
2024-08-20 17:17:59 +00:00
|
|
|
if (theGreenSide[2].league.standingLocal > 0 &&
|
|
|
|
theRedSide[2].league.standingLocal > 0 &&
|
2024-03-24 16:38:06 +00:00
|
|
|
greenSideMode == Mode.player &&
|
|
|
|
redSideMode == Mode.player)
|
|
|
|
CompareThingy(
|
|
|
|
label: t.statCellNum.lbpcShort,
|
|
|
|
greenSide:
|
2024-08-20 17:17:59 +00:00
|
|
|
theGreenSide[2].league.standingLocal,
|
|
|
|
redSide: theRedSide[2].league.standingLocal,
|
2024-03-24 16:38:06 +00:00
|
|
|
higherIsBetter: false,
|
|
|
|
),
|
2024-08-20 17:17:59 +00:00
|
|
|
if (theGreenSide[2].league.apm != null &&
|
|
|
|
theRedSide[2].league.apm != null)
|
2024-03-24 16:38:06 +00:00
|
|
|
CompareThingy(
|
|
|
|
label: "APM",
|
2024-08-20 17:17:59 +00:00
|
|
|
greenSide: theGreenSide[2].league.apm!,
|
|
|
|
redSide: theRedSide[2].league.apm!,
|
2024-03-24 16:38:06 +00:00
|
|
|
fractionDigits: 2,
|
|
|
|
higherIsBetter: true,
|
|
|
|
),
|
2024-08-20 17:17:59 +00:00
|
|
|
if (theGreenSide[2].league.pps != null &&
|
|
|
|
theRedSide[2].league.pps != null)
|
2024-03-24 16:38:06 +00:00
|
|
|
CompareThingy(
|
|
|
|
label: "PPS",
|
2024-08-20 17:17:59 +00:00
|
|
|
greenSide: theGreenSide[2].league.pps!,
|
|
|
|
redSide: theRedSide[2].league.pps!,
|
2024-03-24 16:38:06 +00:00
|
|
|
fractionDigits: 2,
|
|
|
|
higherIsBetter: true,
|
|
|
|
),
|
2024-08-20 17:17:59 +00:00
|
|
|
if (theGreenSide[2].league.vs != null &&
|
|
|
|
theRedSide[2].league.vs != null)
|
2024-03-24 16:38:06 +00:00
|
|
|
CompareThingy(
|
|
|
|
label: "VS",
|
2024-08-20 17:17:59 +00:00
|
|
|
greenSide: theGreenSide[2].league.vs!,
|
|
|
|
redSide: theRedSide[2].league.vs!,
|
2024-03-24 16:38:06 +00:00
|
|
|
fractionDigits: 2,
|
|
|
|
higherIsBetter: true,
|
|
|
|
),
|
|
|
|
],
|
|
|
|
)
|
|
|
|
: CompareBoolThingy(
|
2024-08-20 17:17:59 +00:00
|
|
|
greenSide: theGreenSide[2].league.gamesPlayed > 0,
|
|
|
|
redSide: theRedSide[2].league.gamesPlayed > 0,
|
2024-03-24 16:38:06 +00:00
|
|
|
label: t.playedTL,
|
|
|
|
trueIsBetter: false),
|
2024-08-20 17:17:59 +00:00
|
|
|
if (theGreenSide[2].league.nerdStats != null &&
|
|
|
|
theRedSide[2].league.nerdStats != null)
|
2024-03-24 16:38:06 +00:00
|
|
|
Column(
|
|
|
|
children: [
|
2024-08-20 17:17:59 +00:00
|
|
|
const Divider(),
|
2024-03-24 16:38:06 +00:00
|
|
|
Padding(
|
|
|
|
padding: const EdgeInsets.only(bottom: 16),
|
|
|
|
child: Text(t.nerdStats,
|
|
|
|
style: TextStyle(
|
|
|
|
fontFamily: "Eurostile Round Extended",
|
|
|
|
fontSize: bigScreen ? 42 : 28)),
|
|
|
|
),
|
|
|
|
CompareThingy(
|
|
|
|
label: "APP",
|
2024-08-20 17:17:59 +00:00
|
|
|
greenSide: theGreenSide[2].league.nerdStats!.app,
|
|
|
|
redSide: theRedSide[2].league.nerdStats!.app,
|
2024-03-24 16:38:06 +00:00
|
|
|
fractionDigits: 3,
|
|
|
|
higherIsBetter: true,
|
|
|
|
),
|
|
|
|
CompareThingy(
|
|
|
|
label: "VS/APM",
|
2024-08-20 17:17:59 +00:00
|
|
|
greenSide: theGreenSide[2].league.nerdStats!.vsapm,
|
|
|
|
redSide: theRedSide[2].league.nerdStats!.vsapm,
|
2024-03-24 16:38:06 +00:00
|
|
|
fractionDigits: 3,
|
|
|
|
higherIsBetter: true,
|
|
|
|
),
|
|
|
|
CompareThingy(
|
|
|
|
label: "DS/S",
|
2024-08-20 17:17:59 +00:00
|
|
|
greenSide: theGreenSide[2].league.nerdStats!.dss,
|
|
|
|
redSide: theRedSide[2].league.nerdStats!.dss,
|
2024-03-24 16:38:06 +00:00
|
|
|
fractionDigits: 3,
|
|
|
|
higherIsBetter: true,
|
|
|
|
),
|
|
|
|
CompareThingy(
|
|
|
|
label: "DS/P",
|
2024-08-20 17:17:59 +00:00
|
|
|
greenSide: theGreenSide[2].league.nerdStats!.dsp,
|
|
|
|
redSide: theRedSide[2].league.nerdStats!.dsp,
|
2024-03-24 16:38:06 +00:00
|
|
|
fractionDigits: 3,
|
|
|
|
higherIsBetter: true,
|
|
|
|
),
|
|
|
|
CompareThingy(
|
|
|
|
label: "APP + DS/P",
|
|
|
|
greenSide:
|
2024-08-20 17:17:59 +00:00
|
|
|
theGreenSide[2].league.nerdStats!.appdsp,
|
|
|
|
redSide: theRedSide[2].league.nerdStats!.appdsp,
|
2024-03-24 16:38:06 +00:00
|
|
|
fractionDigits: 3,
|
|
|
|
higherIsBetter: true,
|
|
|
|
),
|
|
|
|
CompareThingy(
|
|
|
|
label: t.statCellNum.cheese.replaceAll(RegExp(r'\n'), " "),
|
|
|
|
greenSide:
|
2024-08-20 17:17:59 +00:00
|
|
|
theGreenSide[2].league.nerdStats!.cheese,
|
|
|
|
redSide: theRedSide[2].league.nerdStats!.cheese,
|
2024-03-24 16:38:06 +00:00
|
|
|
fractionDigits: 2,
|
|
|
|
higherIsBetter: true,
|
|
|
|
),
|
|
|
|
CompareThingy(
|
|
|
|
label: "Gb Eff.",
|
2024-08-20 17:17:59 +00:00
|
|
|
greenSide: theGreenSide[2].league.nerdStats!.gbe,
|
|
|
|
redSide: theRedSide[2].league.nerdStats!.gbe,
|
2024-03-24 16:38:06 +00:00
|
|
|
fractionDigits: 3,
|
|
|
|
higherIsBetter: true,
|
|
|
|
),
|
|
|
|
CompareThingy(
|
|
|
|
label: "wAPP",
|
|
|
|
greenSide:
|
2024-08-20 17:17:59 +00:00
|
|
|
theGreenSide[2].league.nerdStats!.nyaapp,
|
|
|
|
redSide: theRedSide[2].league.nerdStats!.nyaapp,
|
2024-03-24 16:38:06 +00:00
|
|
|
fractionDigits: 3,
|
|
|
|
higherIsBetter: true,
|
|
|
|
),
|
|
|
|
CompareThingy(
|
|
|
|
label: "Area",
|
2024-08-20 17:17:59 +00:00
|
|
|
greenSide: theGreenSide[2].league.nerdStats!.area,
|
|
|
|
redSide: theRedSide[2].league.nerdStats!.area,
|
2024-03-24 16:38:06 +00:00
|
|
|
fractionDigits: 2,
|
|
|
|
higherIsBetter: true,
|
|
|
|
),
|
|
|
|
CompareThingy(
|
|
|
|
label: t.statCellNum.estOfTRShort,
|
2024-08-20 17:17:59 +00:00
|
|
|
greenSide: theGreenSide[2].league.estTr!.esttr,
|
|
|
|
redSide: theRedSide[2].league.estTr!.esttr,
|
2024-03-24 16:38:06 +00:00
|
|
|
fractionDigits: 2,
|
|
|
|
higherIsBetter: true,
|
|
|
|
),
|
2024-08-20 17:17:59 +00:00
|
|
|
if (theGreenSide[2].league.gamesPlayed > 9 &&
|
|
|
|
theGreenSide[2].league.gamesPlayed > 9 &&
|
2024-03-24 16:38:06 +00:00
|
|
|
greenSideMode != Mode.stats &&
|
|
|
|
redSideMode != Mode.stats)
|
|
|
|
CompareThingy(
|
|
|
|
label: t.statCellNum.accOfEstShort,
|
2024-08-20 17:17:59 +00:00
|
|
|
greenSide: theGreenSide[2].league.esttracc!,
|
|
|
|
redSide: theRedSide[2].league.esttracc!,
|
2024-03-24 16:38:06 +00:00
|
|
|
fractionDigits: 2,
|
|
|
|
higherIsBetter: true,
|
|
|
|
),
|
|
|
|
CompareThingy(
|
|
|
|
label: "Opener",
|
2024-08-20 17:17:59 +00:00
|
|
|
greenSide: theGreenSide[2].league.playstyle!.opener,
|
|
|
|
redSide: theRedSide[2].league.playstyle!.opener,
|
2024-03-24 16:38:06 +00:00
|
|
|
fractionDigits: 3,
|
|
|
|
higherIsBetter: true,
|
|
|
|
),
|
|
|
|
CompareThingy(
|
|
|
|
label: "Plonk",
|
2024-08-20 17:17:59 +00:00
|
|
|
greenSide: theGreenSide[2].league.playstyle!.plonk,
|
|
|
|
redSide: theRedSide[2].league.playstyle!.plonk,
|
2024-03-24 16:38:06 +00:00
|
|
|
fractionDigits: 3,
|
|
|
|
higherIsBetter: true,
|
|
|
|
),
|
|
|
|
CompareThingy(
|
|
|
|
label: "Stride",
|
2024-08-20 17:17:59 +00:00
|
|
|
greenSide: theGreenSide[2].league.playstyle!.stride,
|
|
|
|
redSide: theRedSide[2].league.playstyle!.stride,
|
2024-03-24 16:38:06 +00:00
|
|
|
fractionDigits: 3,
|
|
|
|
higherIsBetter: true,
|
|
|
|
),
|
|
|
|
CompareThingy(
|
|
|
|
label: "Inf. DS",
|
2024-08-20 17:17:59 +00:00
|
|
|
greenSide: theGreenSide[2].league.playstyle!.infds,
|
|
|
|
redSide: theRedSide[2].league.playstyle!.infds,
|
2024-03-24 16:38:06 +00:00
|
|
|
fractionDigits: 3,
|
|
|
|
higherIsBetter: true,
|
|
|
|
),
|
2024-08-20 17:17:59 +00:00
|
|
|
VsGraphs(theGreenSide[2].league.apm!, theGreenSide[2].league.pps!, theGreenSide[2].league.vs!, theGreenSide[2].league.nerdStats!, theGreenSide[2].league.playstyle!, theRedSide[2].league.apm!, theRedSide[2].league.pps!, theRedSide[2].league.vs!, theRedSide[2].league.nerdStats!, theRedSide[2].league.playstyle!),
|
2024-03-24 16:38:06 +00:00
|
|
|
const Divider(),
|
|
|
|
Padding(
|
|
|
|
padding: const EdgeInsets.only(bottom: 16),
|
|
|
|
child: Text(t.winChance,
|
|
|
|
style: TextStyle(
|
|
|
|
fontFamily: "Eurostile Round Extended",
|
|
|
|
fontSize: bigScreen ? 42 : 28)),
|
|
|
|
),
|
|
|
|
if (greenSideMode != Mode.stats && redSideMode != Mode.stats &&
|
2024-08-20 17:17:59 +00:00
|
|
|
theGreenSide[2].league.gamesPlayed > 9 && theRedSide[2].league.gamesPlayed > 9)
|
2024-03-24 16:38:06 +00:00
|
|
|
CompareThingy(
|
|
|
|
label: t.byGlicko,
|
|
|
|
greenSide: getWinrateByTR(
|
2024-08-20 17:17:59 +00:00
|
|
|
theGreenSide[2].league.glicko!,
|
|
|
|
theGreenSide[2].league.rd!,
|
|
|
|
theRedSide[2].league.glicko!,
|
|
|
|
theRedSide[2].league.rd!) *
|
2024-03-24 16:38:06 +00:00
|
|
|
100,
|
|
|
|
redSide: getWinrateByTR(
|
2024-08-20 17:17:59 +00:00
|
|
|
theRedSide[2].league.glicko!,
|
|
|
|
theRedSide[2].league.rd!,
|
|
|
|
theGreenSide[2].league.glicko!,
|
|
|
|
theGreenSide[2].league.rd!) *
|
2024-03-24 16:38:06 +00:00
|
|
|
100,
|
|
|
|
fractionDigits: 2,
|
|
|
|
higherIsBetter: true,
|
|
|
|
postfix: "%",
|
|
|
|
),
|
|
|
|
CompareThingy(
|
|
|
|
label: t.byEstTR,
|
|
|
|
greenSide: getWinrateByTR(
|
2024-08-20 17:17:59 +00:00
|
|
|
theGreenSide[2].league.estTr!.estglicko,
|
|
|
|
theGreenSide[2].league.rd ?? noTrRd,
|
|
|
|
theRedSide[2].league.estTr!.estglicko,
|
|
|
|
theRedSide[2].league.rd ?? noTrRd) *
|
2024-03-24 16:38:06 +00:00
|
|
|
100,
|
|
|
|
redSide: getWinrateByTR(
|
2024-08-20 17:17:59 +00:00
|
|
|
theRedSide[2].league.estTr!.estglicko,
|
|
|
|
theRedSide[2].league.rd ?? noTrRd,
|
|
|
|
theGreenSide[2].league.estTr!.estglicko,
|
|
|
|
theGreenSide[2].league.rd ?? noTrRd) *
|
2024-03-24 16:38:06 +00:00
|
|
|
100,
|
|
|
|
fractionDigits: 2,
|
|
|
|
higherIsBetter: true,
|
|
|
|
postfix: "%",
|
|
|
|
),
|
|
|
|
],
|
2024-08-20 17:17:59 +00:00
|
|
|
),
|
|
|
|
if (theGreenSide[2].zenith != null && theRedSide[2].zenith != null && greenSideMode == Mode.player && redSideMode == Mode.player) Column(
|
|
|
|
children: [
|
|
|
|
const Divider(),
|
|
|
|
Padding(
|
|
|
|
padding: const EdgeInsets.only(bottom: 16),
|
|
|
|
child: Text(t.quickPlay, style: TextStyle(fontFamily: "Eurostile Round Extended", fontSize: bigScreen ? 42 : 28)),
|
|
|
|
),
|
|
|
|
CompareThingy(
|
|
|
|
label: "Height",
|
|
|
|
greenSide: theGreenSide[2].zenith.stats.zenith!.altitude,
|
|
|
|
redSide: theRedSide[2].zenith.stats.zenith!.altitude,
|
|
|
|
fractionDigits: 2,
|
|
|
|
higherIsBetter: true,
|
|
|
|
postfix: "m",
|
|
|
|
),
|
|
|
|
CompareThingy(
|
|
|
|
label: "Position",
|
|
|
|
greenSide: theGreenSide[2].zenith.rank,
|
|
|
|
redSide: theRedSide[2].zenith.rank,
|
|
|
|
higherIsBetter: false,
|
|
|
|
prefix: "№ ",
|
|
|
|
),
|
|
|
|
CompareThingy(
|
|
|
|
label: "Position (Country)",
|
|
|
|
greenSide: theGreenSide[2].zenith.countryRank,
|
|
|
|
redSide: theRedSide[2].zenith.countryRank,
|
|
|
|
higherIsBetter: false,
|
|
|
|
prefix: "№ ",
|
|
|
|
),
|
|
|
|
CompareThingy(
|
|
|
|
label: "APM",
|
|
|
|
greenSide: theGreenSide[2].zenith.aggregateStats.apm,
|
|
|
|
redSide: theRedSide[2].zenith.aggregateStats.apm,
|
|
|
|
fractionDigits: 2,
|
|
|
|
higherIsBetter: true,
|
|
|
|
),
|
|
|
|
CompareThingy(
|
|
|
|
label: "PPS",
|
|
|
|
greenSide: theGreenSide[2].zenith.aggregateStats.pps,
|
|
|
|
redSide: theRedSide[2].zenith.aggregateStats.pps,
|
|
|
|
fractionDigits: 2,
|
|
|
|
higherIsBetter: true,
|
|
|
|
),
|
|
|
|
CompareThingy(
|
|
|
|
label: "VS",
|
|
|
|
greenSide: theGreenSide[2].zenith.aggregateStats.vs,
|
|
|
|
redSide: theRedSide[2].zenith.aggregateStats.vs,
|
|
|
|
fractionDigits: 2,
|
|
|
|
higherIsBetter: true,
|
|
|
|
),
|
|
|
|
CompareThingy(
|
|
|
|
label: "KO's",
|
|
|
|
greenSide: theGreenSide[2].zenith.stats.kills,
|
|
|
|
redSide: theRedSide[2].zenith.stats.kills,
|
|
|
|
higherIsBetter: true,
|
|
|
|
),
|
|
|
|
CompareThingy(
|
|
|
|
label: "CPS",
|
|
|
|
greenSide: theGreenSide[2].zenith.stats.cps,
|
|
|
|
redSide: theRedSide[2].zenith.stats.cps,
|
|
|
|
fractionDigits: 2,
|
|
|
|
higherIsBetter: true,
|
|
|
|
),
|
|
|
|
CompareThingy(
|
|
|
|
label: "Peak CPS",
|
|
|
|
greenSide: theGreenSide[2].zenith.stats.zenith!.peakrank,
|
|
|
|
redSide: theRedSide[2].zenith.stats.zenith!.peakrank,
|
|
|
|
fractionDigits: 2,
|
|
|
|
higherIsBetter: true,
|
|
|
|
),
|
|
|
|
CompareDurationThingy(
|
|
|
|
label: "Time",
|
|
|
|
greenSide: theGreenSide[2].zenith.stats.finalTime,
|
|
|
|
redSide: theRedSide[2].zenith.stats.finalTime,
|
|
|
|
higherIsBetter: false,
|
|
|
|
),
|
|
|
|
CompareThingy(
|
|
|
|
label: "Finesse",
|
|
|
|
greenSide: theGreenSide[2].zenith.stats.finessePercentage * 100,
|
|
|
|
redSide: theRedSide[2].zenith.stats.finessePercentage * 100,
|
|
|
|
fractionDigits: 2,
|
|
|
|
postfix: "%",
|
|
|
|
higherIsBetter: true,
|
|
|
|
),
|
|
|
|
const Divider(),
|
|
|
|
Padding(
|
|
|
|
padding: const EdgeInsets.only(bottom: 16),
|
|
|
|
child: Text("${t.quickPlay} ${t.nerdStats}", style: TextStyle(fontFamily: "Eurostile Round Extended", fontSize: 28)),
|
|
|
|
),
|
|
|
|
CompareThingy(
|
|
|
|
label: "APP",
|
|
|
|
greenSide: theGreenSide[2].zenith.aggregateStats.nerdStats.app,
|
|
|
|
redSide: theRedSide[2].zenith.aggregateStats.nerdStats.app,
|
|
|
|
fractionDigits: 3,
|
|
|
|
higherIsBetter: true,
|
|
|
|
),
|
|
|
|
CompareThingy(
|
|
|
|
label: "VS/APM",
|
|
|
|
greenSide: theGreenSide[2].zenith.aggregateStats.nerdStats.vsapm,
|
|
|
|
redSide: theRedSide[2].zenith.aggregateStats.nerdStats.vsapm,
|
|
|
|
fractionDigits: 3,
|
|
|
|
higherIsBetter: true,
|
|
|
|
),
|
|
|
|
CompareThingy(
|
|
|
|
label: "DS/S",
|
|
|
|
greenSide: theGreenSide[2].zenith.aggregateStats.nerdStats.dss,
|
|
|
|
redSide: theRedSide[2].zenith.aggregateStats.nerdStats.dss,
|
|
|
|
fractionDigits: 3,
|
|
|
|
higherIsBetter: true,
|
|
|
|
),
|
|
|
|
CompareThingy(
|
|
|
|
label: "DS/P",
|
|
|
|
greenSide: theGreenSide[2].zenith.aggregateStats.nerdStats.dsp,
|
|
|
|
redSide: theRedSide[2].zenith.aggregateStats.nerdStats.dsp,
|
|
|
|
fractionDigits: 3,
|
|
|
|
higherIsBetter: true,
|
|
|
|
),
|
|
|
|
CompareThingy(
|
|
|
|
label: "APP + DS/P",
|
|
|
|
greenSide:
|
|
|
|
theGreenSide[2].zenith.aggregateStats.nerdStats.appdsp,
|
|
|
|
redSide: theRedSide[2].zenith.aggregateStats.nerdStats.appdsp,
|
|
|
|
fractionDigits: 3,
|
|
|
|
higherIsBetter: true,
|
|
|
|
),
|
|
|
|
CompareThingy(
|
|
|
|
label: t.statCellNum.cheese.replaceAll(RegExp(r'\n'), " "),
|
|
|
|
greenSide:
|
|
|
|
theGreenSide[2].zenith.aggregateStats.nerdStats.cheese,
|
|
|
|
redSide: theRedSide[2].zenith.aggregateStats.nerdStats.cheese,
|
|
|
|
fractionDigits: 2,
|
|
|
|
higherIsBetter: true,
|
|
|
|
),
|
|
|
|
CompareThingy(
|
|
|
|
label: "Gb Eff.",
|
|
|
|
greenSide: theGreenSide[2].zenith.aggregateStats.nerdStats.gbe,
|
|
|
|
redSide: theRedSide[2].zenith.aggregateStats.nerdStats.gbe,
|
|
|
|
fractionDigits: 3,
|
|
|
|
higherIsBetter: true,
|
|
|
|
),
|
|
|
|
CompareThingy(
|
|
|
|
label: "wAPP",
|
|
|
|
greenSide:
|
|
|
|
theGreenSide[2].zenith.aggregateStats.nerdStats.nyaapp,
|
|
|
|
redSide: theRedSide[2].zenith.aggregateStats.nerdStats.nyaapp,
|
|
|
|
fractionDigits: 3,
|
|
|
|
higherIsBetter: true,
|
|
|
|
),
|
|
|
|
CompareThingy(
|
|
|
|
label: "Area",
|
|
|
|
greenSide: theGreenSide[2].zenith.aggregateStats.nerdStats.area,
|
|
|
|
redSide: theRedSide[2].zenith.aggregateStats.nerdStats.area,
|
|
|
|
fractionDigits: 2,
|
|
|
|
higherIsBetter: true,
|
|
|
|
),
|
|
|
|
CompareThingy(
|
|
|
|
label: "Opener",
|
|
|
|
greenSide: theGreenSide[2].zenith.aggregateStats.playstyle.opener,
|
|
|
|
redSide: theRedSide[2].zenith.aggregateStats.playstyle.opener,
|
|
|
|
fractionDigits: 3,
|
|
|
|
higherIsBetter: true,
|
|
|
|
),
|
|
|
|
CompareThingy(
|
|
|
|
label: "Plonk",
|
|
|
|
greenSide: theGreenSide[2].zenith.aggregateStats.playstyle.plonk,
|
|
|
|
redSide: theRedSide[2].zenith.aggregateStats.playstyle.plonk,
|
|
|
|
fractionDigits: 3,
|
|
|
|
higherIsBetter: true,
|
|
|
|
),
|
|
|
|
CompareThingy(
|
|
|
|
label: "Stride",
|
|
|
|
greenSide: theGreenSide[2].zenith.aggregateStats.playstyle.stride,
|
|
|
|
redSide: theRedSide[2].zenith.aggregateStats.playstyle.stride,
|
|
|
|
fractionDigits: 3,
|
|
|
|
higherIsBetter: true,
|
|
|
|
),
|
|
|
|
CompareThingy(
|
|
|
|
label: "Inf. DS",
|
|
|
|
greenSide: theGreenSide[2].zenith.aggregateStats.playstyle.infds,
|
|
|
|
redSide: theRedSide[2].zenith.aggregateStats.playstyle.infds,
|
|
|
|
fractionDigits: 3,
|
|
|
|
higherIsBetter: true,
|
|
|
|
),
|
|
|
|
VsGraphs(theGreenSide[2].zenith.aggregateStats.apm, theGreenSide[2].zenith.aggregateStats.pps, theGreenSide[2].zenith.aggregateStats.vs, theGreenSide[2].zenith.aggregateStats.nerdStats, theGreenSide[2].zenith.aggregateStats.playstyle, theRedSide[2].zenith.aggregateStats.apm, theRedSide[2].zenith.aggregateStats.pps, theRedSide[2].zenith.aggregateStats.vs, theRedSide[2].zenith.aggregateStats.nerdStats, theRedSide[2].zenith.aggregateStats.playstyle),
|
|
|
|
],
|
|
|
|
)
|
|
|
|
else if (greenSideMode == Mode.player && redSideMode == Mode.player) CompareBoolThingy(greenSide: theGreenSide[2].zenith != null, redSide: theRedSide[2].zenith != null, label: "Played QP", trueIsBetter: true),
|
|
|
|
if (theGreenSide[2].zenithEx != null && theRedSide[2].zenithEx != null && greenSideMode == Mode.player && redSideMode == Mode.player) Column(
|
|
|
|
children: [
|
|
|
|
const Divider(),
|
|
|
|
Padding(
|
|
|
|
padding: const EdgeInsets.only(bottom: 16),
|
|
|
|
child: Text("${t.quickPlay} ${t.expert}", style: TextStyle(fontFamily: "Eurostile Round Extended", fontSize: bigScreen ? 42 : 28)),
|
|
|
|
),
|
|
|
|
CompareThingy(
|
|
|
|
label: "Height",
|
|
|
|
greenSide: theGreenSide[2].zenithEx.stats.zenith!.altitude,
|
|
|
|
redSide: theRedSide[2].zenithEx.stats.zenith!.altitude,
|
|
|
|
fractionDigits: 2,
|
|
|
|
higherIsBetter: true,
|
|
|
|
postfix: "m",
|
|
|
|
),
|
|
|
|
CompareThingy(
|
|
|
|
label: "Position",
|
|
|
|
greenSide: theGreenSide[2].zenithEx.rank,
|
|
|
|
redSide: theRedSide[2].zenithEx.rank,
|
|
|
|
higherIsBetter: false,
|
|
|
|
prefix: "№ ",
|
|
|
|
),
|
|
|
|
CompareThingy(
|
|
|
|
label: "Position (Country)",
|
|
|
|
greenSide: theGreenSide[2].zenithEx.countryRank,
|
|
|
|
redSide: theRedSide[2].zenithEx.countryRank,
|
|
|
|
higherIsBetter: false,
|
|
|
|
prefix: "№ ",
|
|
|
|
),
|
|
|
|
CompareThingy(
|
|
|
|
label: "APM",
|
|
|
|
greenSide: theGreenSide[2].zenithEx.aggregateStats.apm,
|
|
|
|
redSide: theRedSide[2].zenithEx.aggregateStats.apm,
|
|
|
|
fractionDigits: 2,
|
|
|
|
higherIsBetter: true,
|
|
|
|
),
|
|
|
|
CompareThingy(
|
|
|
|
label: "PPS",
|
|
|
|
greenSide: theGreenSide[2].zenithEx.aggregateStats.pps,
|
|
|
|
redSide: theRedSide[2].zenithEx.aggregateStats.pps,
|
|
|
|
fractionDigits: 2,
|
|
|
|
higherIsBetter: true,
|
|
|
|
),
|
|
|
|
CompareThingy(
|
|
|
|
label: "VS",
|
|
|
|
greenSide: theGreenSide[2].zenithEx.aggregateStats.vs,
|
|
|
|
redSide: theRedSide[2].zenithEx.aggregateStats.vs,
|
|
|
|
fractionDigits: 2,
|
|
|
|
higherIsBetter: true,
|
|
|
|
),
|
|
|
|
CompareThingy(
|
|
|
|
label: "KO's",
|
|
|
|
greenSide: theGreenSide[2].zenithEx.stats.kills,
|
|
|
|
redSide: theRedSide[2].zenithEx.stats.kills,
|
|
|
|
higherIsBetter: true,
|
|
|
|
),
|
|
|
|
CompareThingy(
|
|
|
|
label: "CPS",
|
|
|
|
greenSide: theGreenSide[2].zenithEx.stats.cps,
|
|
|
|
redSide: theRedSide[2].zenithEx.stats.cps,
|
|
|
|
fractionDigits: 2,
|
|
|
|
higherIsBetter: true,
|
|
|
|
),
|
|
|
|
CompareThingy(
|
|
|
|
label: "Peak CPS",
|
|
|
|
greenSide: theGreenSide[2].zenithEx.stats.zenith!.peakrank,
|
|
|
|
redSide: theRedSide[2].zenithEx.stats.zenith!.peakrank,
|
|
|
|
fractionDigits: 2,
|
|
|
|
higherIsBetter: true,
|
|
|
|
),
|
|
|
|
CompareDurationThingy(
|
|
|
|
label: "Time",
|
|
|
|
greenSide: theGreenSide[2].zenithEx.stats.finalTime,
|
|
|
|
redSide: theRedSide[2].zenithEx.stats.finalTime,
|
|
|
|
higherIsBetter: false,
|
|
|
|
),
|
|
|
|
CompareThingy(
|
|
|
|
label: "Finesse",
|
|
|
|
greenSide: theGreenSide[2].zenithEx.stats.finessePercentage * 100,
|
|
|
|
redSide: theRedSide[2].zenithEx.stats.finessePercentage * 100,
|
|
|
|
fractionDigits: 2,
|
|
|
|
postfix: "%",
|
|
|
|
higherIsBetter: true,
|
|
|
|
),
|
|
|
|
const Divider(),
|
|
|
|
Padding(
|
|
|
|
padding: const EdgeInsets.only(bottom: 16),
|
2024-09-01 21:44:19 +00:00
|
|
|
child: Text("${t.quickPlay} ${t.expert} ${t.nerdStats}", style: const TextStyle(fontFamily: "Eurostile Round Extended", fontSize: 28)),
|
2024-08-20 17:17:59 +00:00
|
|
|
),
|
|
|
|
CompareThingy(
|
|
|
|
label: "APP",
|
|
|
|
greenSide: theGreenSide[2].zenithEx.aggregateStats.nerdStats.app,
|
|
|
|
redSide: theRedSide[2].zenithEx.aggregateStats.nerdStats.app,
|
|
|
|
fractionDigits: 3,
|
|
|
|
higherIsBetter: true,
|
|
|
|
),
|
|
|
|
CompareThingy(
|
|
|
|
label: "VS/APM",
|
|
|
|
greenSide: theGreenSide[2].zenithEx.aggregateStats.nerdStats.vsapm,
|
|
|
|
redSide: theRedSide[2].zenithEx.aggregateStats.nerdStats.vsapm,
|
|
|
|
fractionDigits: 3,
|
|
|
|
higherIsBetter: true,
|
|
|
|
),
|
|
|
|
CompareThingy(
|
|
|
|
label: "DS/S",
|
|
|
|
greenSide: theGreenSide[2].zenithEx.aggregateStats.nerdStats.dss,
|
|
|
|
redSide: theRedSide[2].zenithEx.aggregateStats.nerdStats.dss,
|
|
|
|
fractionDigits: 3,
|
|
|
|
higherIsBetter: true,
|
|
|
|
),
|
|
|
|
CompareThingy(
|
|
|
|
label: "DS/P",
|
|
|
|
greenSide: theGreenSide[2].zenithEx.aggregateStats.nerdStats.dsp,
|
|
|
|
redSide: theRedSide[2].zenithEx.aggregateStats.nerdStats.dsp,
|
|
|
|
fractionDigits: 3,
|
|
|
|
higherIsBetter: true,
|
|
|
|
),
|
|
|
|
CompareThingy(
|
|
|
|
label: "APP + DS/P",
|
|
|
|
greenSide:
|
|
|
|
theGreenSide[2].zenithEx.aggregateStats.nerdStats.appdsp,
|
|
|
|
redSide: theRedSide[2].zenithEx.aggregateStats.nerdStats.appdsp,
|
|
|
|
fractionDigits: 3,
|
|
|
|
higherIsBetter: true,
|
|
|
|
),
|
|
|
|
CompareThingy(
|
|
|
|
label: t.statCellNum.cheese.replaceAll(RegExp(r'\n'), " "),
|
|
|
|
greenSide:
|
|
|
|
theGreenSide[2].zenithEx.aggregateStats.nerdStats.cheese,
|
|
|
|
redSide: theRedSide[2].zenithEx.aggregateStats.nerdStats.cheese,
|
|
|
|
fractionDigits: 2,
|
|
|
|
higherIsBetter: true,
|
|
|
|
),
|
|
|
|
CompareThingy(
|
|
|
|
label: "Gb Eff.",
|
|
|
|
greenSide: theGreenSide[2].zenithEx.aggregateStats.nerdStats.gbe,
|
|
|
|
redSide: theRedSide[2].zenithEx.aggregateStats.nerdStats.gbe,
|
|
|
|
fractionDigits: 3,
|
|
|
|
higherIsBetter: true,
|
|
|
|
),
|
|
|
|
CompareThingy(
|
|
|
|
label: "wAPP",
|
|
|
|
greenSide:
|
|
|
|
theGreenSide[2].zenithEx.aggregateStats.nerdStats.nyaapp,
|
|
|
|
redSide: theRedSide[2].zenithEx.aggregateStats.nerdStats.nyaapp,
|
|
|
|
fractionDigits: 3,
|
|
|
|
higherIsBetter: true,
|
|
|
|
),
|
|
|
|
CompareThingy(
|
|
|
|
label: "Area",
|
|
|
|
greenSide: theGreenSide[2].zenithEx.aggregateStats.nerdStats.area,
|
|
|
|
redSide: theRedSide[2].zenithEx.aggregateStats.nerdStats.area,
|
|
|
|
fractionDigits: 2,
|
|
|
|
higherIsBetter: true,
|
|
|
|
),
|
|
|
|
CompareThingy(
|
|
|
|
label: "Opener",
|
|
|
|
greenSide: theGreenSide[2].zenithEx.aggregateStats.playstyle.opener,
|
|
|
|
redSide: theRedSide[2].zenithEx.aggregateStats.playstyle.opener,
|
|
|
|
fractionDigits: 3,
|
|
|
|
higherIsBetter: true,
|
|
|
|
),
|
|
|
|
CompareThingy(
|
|
|
|
label: "Plonk",
|
|
|
|
greenSide: theGreenSide[2].zenithEx.aggregateStats.playstyle.plonk,
|
|
|
|
redSide: theRedSide[2].zenithEx.aggregateStats.playstyle.plonk,
|
|
|
|
fractionDigits: 3,
|
|
|
|
higherIsBetter: true,
|
|
|
|
),
|
|
|
|
CompareThingy(
|
|
|
|
label: "Stride",
|
|
|
|
greenSide: theGreenSide[2].zenithEx.aggregateStats.playstyle.stride,
|
|
|
|
redSide: theRedSide[2].zenithEx.aggregateStats.playstyle.stride,
|
|
|
|
fractionDigits: 3,
|
|
|
|
higherIsBetter: true,
|
|
|
|
),
|
|
|
|
CompareThingy(
|
|
|
|
label: "Inf. DS",
|
|
|
|
greenSide: theGreenSide[2].zenithEx.aggregateStats.playstyle.infds,
|
|
|
|
redSide: theRedSide[2].zenithEx.aggregateStats.playstyle.infds,
|
|
|
|
fractionDigits: 3,
|
|
|
|
higherIsBetter: true,
|
|
|
|
),
|
|
|
|
VsGraphs(theGreenSide[2].zenithEx.aggregateStats.apm, theGreenSide[2].zenithEx.aggregateStats.pps, theGreenSide[2].zenithEx.aggregateStats.vs, theGreenSide[2].zenithEx.aggregateStats.nerdStats, theGreenSide[2].zenithEx.aggregateStats.playstyle, theRedSide[2].zenithEx.aggregateStats.apm, theRedSide[2].zenithEx.aggregateStats.pps, theRedSide[2].zenithEx.aggregateStats.vs, theRedSide[2].zenithEx.aggregateStats.nerdStats, theRedSide[2].zenithEx.aggregateStats.playstyle),
|
|
|
|
],
|
|
|
|
)
|
|
|
|
else if (greenSideMode == Mode.player && redSideMode == Mode.player) CompareBoolThingy(greenSide: theGreenSide[2].zenithEx != null, redSide: theRedSide[2].zenithEx != null, label: "Played QP Expert", trueIsBetter: true),
|
|
|
|
if (theGreenSide[2].sprint != null && theRedSide[2].sprint != null && greenSideMode == Mode.player && redSideMode == Mode.player) Column(
|
|
|
|
children: [
|
|
|
|
const Divider(),
|
|
|
|
Padding(
|
|
|
|
padding: const EdgeInsets.only(bottom: 16),
|
|
|
|
child: Text(t.sprint, style: TextStyle(fontFamily: "Eurostile Round Extended", fontSize: bigScreen ? 42 : 28)),
|
|
|
|
),
|
|
|
|
CompareDurationThingy(
|
|
|
|
label: "Time",
|
|
|
|
greenSide: theGreenSide[2].sprint.stats.finalTime,
|
|
|
|
redSide: theRedSide[2].sprint.stats.finalTime,
|
|
|
|
higherIsBetter: false,
|
|
|
|
),
|
|
|
|
CompareThingy(
|
|
|
|
label: "Lines",
|
|
|
|
greenSide: theGreenSide[2].sprint.stats.lines,
|
|
|
|
redSide: theRedSide[2].sprint.stats.lines,
|
|
|
|
higherIsBetter: false,
|
|
|
|
),
|
|
|
|
CompareThingy(
|
|
|
|
label: t.statCellNum.pieces.replaceAll(RegExp(r'\n'), " "),
|
|
|
|
greenSide: theGreenSide[2].sprint.stats.piecesPlaced,
|
|
|
|
redSide: theRedSide[2].sprint.stats.piecesPlaced,
|
|
|
|
higherIsBetter: false,
|
|
|
|
),
|
|
|
|
CompareThingy(
|
|
|
|
label: t.statCellNum.keys.replaceAll(RegExp(r'\n'), " "),
|
|
|
|
greenSide: theGreenSide[2].sprint.stats.inputs,
|
|
|
|
redSide: theRedSide[2].sprint.stats.inputs,
|
|
|
|
higherIsBetter: false,
|
|
|
|
),
|
|
|
|
CompareThingy(
|
|
|
|
label: "PPS",
|
|
|
|
greenSide: theGreenSide[2].sprint.stats.pps,
|
|
|
|
redSide: theRedSide[2].sprint.stats.pps,
|
|
|
|
fractionDigits: 2,
|
|
|
|
higherIsBetter: true,
|
|
|
|
),
|
|
|
|
CompareThingy(
|
|
|
|
label: "KPP",
|
|
|
|
greenSide: theGreenSide[2].sprint.stats.kpp,
|
|
|
|
redSide: theRedSide[2].sprint.stats.kpp,
|
|
|
|
fractionDigits: 2,
|
|
|
|
higherIsBetter: false,
|
|
|
|
),
|
|
|
|
CompareThingy(
|
|
|
|
label: "KPS",
|
|
|
|
greenSide: theGreenSide[2].sprint.stats.kps,
|
|
|
|
redSide: theRedSide[2].sprint.stats.kps,
|
|
|
|
fractionDigits: 2,
|
|
|
|
higherIsBetter: true,
|
|
|
|
),
|
|
|
|
CompareThingy(
|
|
|
|
label: "Finesse",
|
|
|
|
greenSide: theGreenSide[2].sprint.stats.finessePercentage * 100,
|
|
|
|
redSide: theRedSide[2].sprint.stats.finessePercentage * 100,
|
|
|
|
fractionDigits: 2,
|
|
|
|
postfix: "%",
|
|
|
|
higherIsBetter: true,
|
|
|
|
),
|
|
|
|
CompareThingy(
|
|
|
|
label: "Holds",
|
|
|
|
greenSide: theGreenSide[2].sprint.stats.holds,
|
|
|
|
redSide: theRedSide[2].sprint.stats.holds,
|
|
|
|
higherIsBetter: false,
|
|
|
|
),
|
|
|
|
CompareThingy(
|
|
|
|
label: "T-spins",
|
|
|
|
greenSide: theGreenSide[2].sprint.stats.tSpins,
|
|
|
|
redSide: theRedSide[2].sprint.stats.tSpins,
|
|
|
|
higherIsBetter: false,
|
|
|
|
),
|
|
|
|
CompareThingy(
|
|
|
|
label: "Quads",
|
|
|
|
greenSide: theGreenSide[2].sprint.stats.clears.quads,
|
|
|
|
redSide: theRedSide[2].sprint.stats.clears.quads,
|
|
|
|
higherIsBetter: true,
|
|
|
|
),
|
|
|
|
CompareThingy(
|
|
|
|
label: "PC's",
|
|
|
|
greenSide: theGreenSide[2].sprint.stats.clears.allClears,
|
|
|
|
redSide: theRedSide[2].sprint.stats.clears.allClears,
|
|
|
|
higherIsBetter: true,
|
|
|
|
),
|
|
|
|
],
|
|
|
|
)
|
|
|
|
else if (greenSideMode == Mode.player && redSideMode == Mode.player) CompareBoolThingy(greenSide: theGreenSide[2].sprint != null, redSide: theRedSide[2].sprint != null, label: "Played 40 Lines", trueIsBetter: true),
|
|
|
|
if (theGreenSide[2].blitz != null && theRedSide[2].blitz != null && greenSideMode == Mode.player && redSideMode == Mode.player) Column(
|
|
|
|
children: [
|
|
|
|
const Divider(),
|
|
|
|
Padding(
|
|
|
|
padding: const EdgeInsets.only(bottom: 16),
|
|
|
|
child: Text(t.blitz, style: TextStyle(fontFamily: "Eurostile Round Extended", fontSize: bigScreen ? 42 : 28)),
|
|
|
|
),
|
|
|
|
CompareThingy(
|
|
|
|
label: "Score",
|
|
|
|
greenSide: theGreenSide[2].blitz.stats.score,
|
|
|
|
redSide: theRedSide[2].blitz.stats.score,
|
|
|
|
higherIsBetter: true,
|
|
|
|
),
|
|
|
|
CompareThingy(
|
|
|
|
label: "SPP",
|
|
|
|
greenSide: theGreenSide[2].blitz.stats.spp,
|
|
|
|
redSide: theRedSide[2].blitz.stats.spp,
|
|
|
|
fractionDigits: 2,
|
|
|
|
higherIsBetter: true,
|
|
|
|
),
|
|
|
|
CompareThingy(
|
|
|
|
label: "Level",
|
|
|
|
greenSide: theGreenSide[2].blitz.stats.level,
|
|
|
|
redSide: theRedSide[2].blitz.stats.level,
|
|
|
|
higherIsBetter: true,
|
|
|
|
),
|
|
|
|
CompareThingy(
|
|
|
|
label: "Lines",
|
|
|
|
greenSide: theGreenSide[2].blitz.stats.lines,
|
|
|
|
redSide: theRedSide[2].blitz.stats.lines,
|
|
|
|
higherIsBetter: true,
|
|
|
|
),
|
|
|
|
CompareThingy(
|
|
|
|
label: t.statCellNum.pieces.replaceAll(RegExp(r'\n'), " "),
|
|
|
|
greenSide: theGreenSide[2].blitz.stats.piecesPlaced,
|
|
|
|
redSide: theRedSide[2].blitz.stats.piecesPlaced,
|
|
|
|
higherIsBetter: true,
|
|
|
|
),
|
|
|
|
CompareThingy(
|
|
|
|
label: t.statCellNum.keys.replaceAll(RegExp(r'\n'), " "),
|
|
|
|
greenSide: theGreenSide[2].blitz.stats.inputs,
|
|
|
|
redSide: theRedSide[2].blitz.stats.inputs,
|
|
|
|
higherIsBetter: true,
|
|
|
|
),
|
|
|
|
CompareThingy(
|
|
|
|
label: "PPS",
|
|
|
|
greenSide: theGreenSide[2].blitz.stats.pps,
|
|
|
|
redSide: theRedSide[2].blitz.stats.pps,
|
|
|
|
fractionDigits: 2,
|
|
|
|
higherIsBetter: true,
|
|
|
|
),
|
|
|
|
CompareThingy(
|
|
|
|
label: "KPP",
|
|
|
|
greenSide: theGreenSide[2].blitz.stats.kpp,
|
|
|
|
redSide: theRedSide[2].blitz.stats.kpp,
|
|
|
|
fractionDigits: 2,
|
|
|
|
higherIsBetter: false,
|
|
|
|
),
|
|
|
|
CompareThingy(
|
|
|
|
label: "KPS",
|
|
|
|
greenSide: theGreenSide[2].blitz.stats.kps,
|
|
|
|
redSide: theRedSide[2].blitz.stats.kps,
|
|
|
|
fractionDigits: 2,
|
|
|
|
higherIsBetter: true,
|
|
|
|
),
|
|
|
|
CompareThingy(
|
|
|
|
label: "Finesse",
|
|
|
|
greenSide: theGreenSide[2].blitz.stats.finessePercentage * 100,
|
|
|
|
redSide: theRedSide[2].blitz.stats.finessePercentage * 100,
|
|
|
|
fractionDigits: 2,
|
|
|
|
postfix: "%",
|
|
|
|
higherIsBetter: true,
|
|
|
|
),
|
|
|
|
CompareThingy(
|
|
|
|
label: "Holds",
|
|
|
|
greenSide: theGreenSide[2].blitz.stats.holds,
|
|
|
|
redSide: theRedSide[2].blitz.stats.holds,
|
|
|
|
higherIsBetter: false,
|
|
|
|
),
|
|
|
|
CompareThingy(
|
|
|
|
label: "T-spins",
|
|
|
|
greenSide: theGreenSide[2].blitz.stats.tSpins,
|
|
|
|
redSide: theRedSide[2].blitz.stats.tSpins,
|
|
|
|
higherIsBetter: false,
|
|
|
|
),
|
|
|
|
CompareThingy(
|
|
|
|
label: "Quads",
|
|
|
|
greenSide: theGreenSide[2].blitz.stats.clears.quads,
|
|
|
|
redSide: theRedSide[2].blitz.stats.clears.quads,
|
|
|
|
higherIsBetter: true,
|
|
|
|
),
|
|
|
|
CompareThingy(
|
|
|
|
label: "PC's",
|
|
|
|
greenSide: theGreenSide[2].blitz.stats.clears.allClears,
|
|
|
|
redSide: theRedSide[2].blitz.stats.clears.allClears,
|
|
|
|
higherIsBetter: true,
|
|
|
|
),
|
|
|
|
],
|
|
|
|
)
|
|
|
|
else if (greenSideMode == Mode.player && redSideMode == Mode.player) CompareBoolThingy(greenSide: theGreenSide[2].blitz != null, redSide: theRedSide[2].blitz != null, label: "Played Blitz", trueIsBetter: true),
|
|
|
|
if (greenSideMode == Mode.player && redSideMode == Mode.player) Column(
|
|
|
|
children: [
|
|
|
|
const Divider(),
|
|
|
|
Padding(
|
|
|
|
padding: const EdgeInsets.only(bottom: 16),
|
|
|
|
child: Text(t.zen, style: TextStyle(fontFamily: "Eurostile Round Extended", fontSize: bigScreen ? 42 : 28)),
|
|
|
|
),
|
|
|
|
CompareThingy(
|
|
|
|
label: "Level",
|
|
|
|
greenSide: theGreenSide[2].zen.level,
|
|
|
|
redSide: theRedSide[2].zen.level,
|
|
|
|
higherIsBetter: true,
|
|
|
|
),
|
|
|
|
CompareThingy(
|
|
|
|
label: "Score",
|
|
|
|
greenSide: theGreenSide[2].zen.score,
|
|
|
|
redSide: theRedSide[2].zen.score,
|
|
|
|
higherIsBetter: true,
|
|
|
|
),
|
|
|
|
],
|
2024-03-24 16:38:06 +00:00
|
|
|
)
|
|
|
|
],
|
|
|
|
)
|
|
|
|
else Padding(
|
|
|
|
padding: const EdgeInsets.all(8.0),
|
|
|
|
child: Text(t.compareViewNoValues(avgR: "\$avgR"), textAlign: TextAlign.center),
|
|
|
|
)
|
2024-08-20 17:17:59 +00:00
|
|
|
],
|
2024-03-02 22:26:31 +00:00
|
|
|
),
|
|
|
|
),
|
2023-06-17 21:50:52 +00:00
|
|
|
),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
class PlayerSelector extends StatelessWidget {
|
2023-07-06 12:48:04 +00:00
|
|
|
final List data;
|
|
|
|
final Mode mode;
|
2023-06-19 20:42:37 +00:00
|
|
|
final Function fetch;
|
2023-06-17 21:50:52 +00:00
|
|
|
final Function change;
|
|
|
|
final Function updateState;
|
2023-08-21 15:39:04 +00:00
|
|
|
const PlayerSelector(
|
2023-06-19 20:42:37 +00:00
|
|
|
{super.key,
|
2023-07-06 12:48:04 +00:00
|
|
|
required this.data,
|
|
|
|
required this.mode,
|
2023-06-19 20:42:37 +00:00
|
|
|
required this.updateState,
|
2023-07-06 12:48:04 +00:00
|
|
|
required this.fetch,
|
|
|
|
required this.change});
|
2023-06-17 21:50:52 +00:00
|
|
|
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
final TextEditingController playerController = TextEditingController();
|
2023-07-10 17:42:20 +00:00
|
|
|
String underFieldString = "";
|
2023-07-06 12:48:04 +00:00
|
|
|
if (!listEquals(data, [null, null, null])){
|
|
|
|
switch (mode){
|
|
|
|
case Mode.player:
|
2023-07-10 17:42:20 +00:00
|
|
|
playerController.text = data[0] != null ? data[0].username : "";
|
2023-07-06 12:48:04 +00:00
|
|
|
break;
|
|
|
|
case Mode.stats:
|
2024-08-20 17:17:59 +00:00
|
|
|
playerController.text = "${data[2].league.apm} ${data[2].league.pps} ${data[2].league.vs}";
|
2023-07-06 12:48:04 +00:00
|
|
|
break;
|
|
|
|
case Mode.averages:
|
2024-08-20 17:17:59 +00:00
|
|
|
playerController.text = "\$avg${data[2].league.rank.toUpperCase()}";
|
2023-07-10 17:42:20 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (!listEquals(data, [null, null, null])){
|
|
|
|
switch (mode){
|
|
|
|
case Mode.player:
|
|
|
|
underFieldString = data[0] != null ? data[0].toString() : "???";
|
|
|
|
break;
|
|
|
|
case Mode.stats:
|
2024-08-20 17:17:59 +00:00
|
|
|
underFieldString = "${data[2].league.apm} APM, ${data[2].league.pps} PPS, ${data[2].league.vs} VS";
|
2023-07-10 17:42:20 +00:00
|
|
|
break;
|
|
|
|
case Mode.averages:
|
2024-08-20 17:17:59 +00:00
|
|
|
underFieldString = t.averageXrank(rankLetter: data[2].league.rank.toUpperCase());
|
2023-07-06 12:48:04 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2023-06-17 21:50:52 +00:00
|
|
|
return Column(
|
|
|
|
children: [
|
|
|
|
TextField(
|
|
|
|
autocorrect: false,
|
|
|
|
enableSuggestions: false,
|
|
|
|
maxLength: 25,
|
|
|
|
controller: playerController,
|
|
|
|
decoration: const InputDecoration(counter: Offstage()),
|
|
|
|
onSubmitted: (String value) {
|
2023-07-10 17:42:20 +00:00
|
|
|
underFieldString = "Fetching...";
|
2023-06-19 20:42:37 +00:00
|
|
|
fetch(value);
|
2023-06-17 21:50:52 +00:00
|
|
|
}),
|
2023-07-10 17:42:20 +00:00
|
|
|
if (data[0] != null && data[1] != null)
|
|
|
|
Padding(
|
|
|
|
padding: const EdgeInsets.only(bottom: 8.0),
|
|
|
|
child: DropdownButton(
|
|
|
|
items: data[1],
|
|
|
|
value: data[0],
|
|
|
|
onChanged: (value) => change(value!),
|
|
|
|
),
|
|
|
|
)
|
|
|
|
else Text(
|
|
|
|
underFieldString,
|
2023-06-17 21:50:52 +00:00
|
|
|
style: const TextStyle(
|
|
|
|
shadows: <Shadow>[
|
|
|
|
Shadow(
|
|
|
|
offset: Offset(0.0, 0.0),
|
|
|
|
blurRadius: 3.0,
|
|
|
|
color: Colors.black,
|
|
|
|
),
|
|
|
|
Shadow(
|
|
|
|
offset: Offset(0.0, 0.0),
|
|
|
|
blurRadius: 8.0,
|
|
|
|
color: Colors.black,
|
|
|
|
),
|
|
|
|
],
|
|
|
|
),
|
2023-06-19 20:42:37 +00:00
|
|
|
),
|
2023-06-17 21:50:52 +00:00
|
|
|
],
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-03-02 22:26:31 +00:00
|
|
|
const TextStyle verdictStyle = TextStyle(fontSize: 14, fontFamily: "Eurostile Round Condensed", color: Colors.grey, height: 1.1);
|
|
|
|
|
2023-06-17 21:50:52 +00:00
|
|
|
class CompareThingy extends StatelessWidget {
|
|
|
|
final num greenSide;
|
|
|
|
final num redSide;
|
|
|
|
final String label;
|
|
|
|
final bool higherIsBetter;
|
|
|
|
final int? fractionDigits;
|
2024-01-01 21:43:12 +00:00
|
|
|
final String? postfix;
|
2024-01-06 22:54:00 +00:00
|
|
|
final String? prefix;
|
2023-06-19 20:42:37 +00:00
|
|
|
const CompareThingy(
|
|
|
|
{super.key,
|
|
|
|
required this.greenSide,
|
|
|
|
required this.redSide,
|
|
|
|
required this.label,
|
|
|
|
required this.higherIsBetter,
|
2024-01-01 21:43:12 +00:00
|
|
|
this.fractionDigits,
|
2024-01-06 22:54:00 +00:00
|
|
|
this.prefix,
|
2024-01-01 21:43:12 +00:00
|
|
|
this.postfix});
|
2023-06-17 21:50:52 +00:00
|
|
|
|
|
|
|
String verdict(num greenSide, num redSide, int fraction) {
|
|
|
|
var f = NumberFormat("+#,###.##;-#,###.##");
|
|
|
|
f.maximumFractionDigits = fraction;
|
2024-01-01 21:43:12 +00:00
|
|
|
return f.format((greenSide - redSide)) + (postfix ?? "");
|
2023-06-17 21:50:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
2023-07-15 16:22:25 +00:00
|
|
|
var f = NumberFormat.decimalPattern(LocaleSettings.currentLocale.languageCode);
|
2023-06-17 21:50:52 +00:00
|
|
|
f.maximumFractionDigits = fractionDigits ?? 0;
|
|
|
|
return Padding(
|
|
|
|
padding: const EdgeInsets.fromLTRB(16, 2, 16, 2),
|
|
|
|
child: Row(
|
|
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
children: [
|
|
|
|
Expanded(
|
|
|
|
child: Container(
|
|
|
|
padding: const EdgeInsets.all(4),
|
|
|
|
decoration: BoxDecoration(
|
2024-04-20 22:37:31 +00:00
|
|
|
gradient: LinearGradient(
|
|
|
|
colors: const [Colors.green, Colors.transparent],
|
|
|
|
begin: Alignment.centerLeft,
|
|
|
|
end: Alignment.centerRight,
|
2024-05-04 20:04:48 +00:00
|
|
|
transform: const GradientRotation(0.6),
|
2024-04-20 22:37:31 +00:00
|
|
|
stops: [
|
|
|
|
0.0,
|
|
|
|
higherIsBetter
|
|
|
|
? greenSide > redSide
|
|
|
|
? 0.6
|
|
|
|
: 0
|
|
|
|
: greenSide < redSide
|
|
|
|
? 0.6
|
|
|
|
: 0
|
|
|
|
],
|
|
|
|
)
|
|
|
|
),
|
2023-06-17 21:50:52 +00:00
|
|
|
child: Text(
|
2024-01-06 22:54:00 +00:00
|
|
|
(prefix ?? "") + f.format(greenSide) + (postfix ?? ""),
|
2023-06-17 21:50:52 +00:00
|
|
|
style: const TextStyle(
|
|
|
|
fontSize: 22,
|
|
|
|
shadows: <Shadow>[
|
|
|
|
Shadow(
|
|
|
|
offset: Offset(0.0, 0.0),
|
2024-04-20 22:37:31 +00:00
|
|
|
blurRadius: 1.0,
|
|
|
|
color: Colors.black,
|
|
|
|
),
|
|
|
|
Shadow(
|
|
|
|
offset: Offset(0.0, 0.0),
|
|
|
|
blurRadius: 2.0,
|
2023-06-17 21:50:52 +00:00
|
|
|
color: Colors.black,
|
|
|
|
),
|
|
|
|
Shadow(
|
|
|
|
offset: Offset(0.0, 0.0),
|
|
|
|
blurRadius: 8.0,
|
|
|
|
color: Colors.black,
|
|
|
|
),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
textAlign: TextAlign.start,
|
|
|
|
),
|
|
|
|
)),
|
|
|
|
Column(
|
|
|
|
children: [
|
|
|
|
Text(
|
|
|
|
label,
|
|
|
|
style: const TextStyle(fontSize: 22),
|
|
|
|
textAlign: TextAlign.center,
|
|
|
|
),
|
|
|
|
Text(
|
2023-06-19 20:42:37 +00:00
|
|
|
verdict(greenSide, redSide,
|
|
|
|
fractionDigits != null ? fractionDigits! + 2 : 0),
|
2024-03-02 22:26:31 +00:00
|
|
|
style: verdictStyle,
|
2023-06-17 21:50:52 +00:00
|
|
|
textAlign: TextAlign.center,
|
|
|
|
)
|
|
|
|
],
|
|
|
|
),
|
|
|
|
Expanded(
|
|
|
|
child: Container(
|
|
|
|
padding: const EdgeInsets.all(4),
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
gradient: LinearGradient(
|
|
|
|
colors: const [Colors.red, Colors.transparent],
|
|
|
|
begin: Alignment.centerRight,
|
|
|
|
end: Alignment.centerLeft,
|
2024-05-04 20:04:48 +00:00
|
|
|
transform: const GradientRotation(-0.6),
|
2023-06-17 21:50:52 +00:00
|
|
|
stops: [
|
|
|
|
0.0,
|
|
|
|
higherIsBetter
|
|
|
|
? redSide > greenSide
|
|
|
|
? 0.6
|
|
|
|
: 0
|
|
|
|
: redSide < greenSide
|
|
|
|
? 0.6
|
|
|
|
: 0
|
|
|
|
],
|
|
|
|
)),
|
|
|
|
child: Text(
|
2024-01-06 22:54:00 +00:00
|
|
|
(prefix ?? "") + f.format(redSide) + (postfix ?? ""),
|
2023-06-17 21:50:52 +00:00
|
|
|
style: const TextStyle(
|
|
|
|
fontSize: 22,
|
|
|
|
shadows: <Shadow>[
|
|
|
|
Shadow(
|
|
|
|
offset: Offset(0.0, 0.0),
|
|
|
|
blurRadius: 3.0,
|
|
|
|
color: Colors.black,
|
|
|
|
),
|
|
|
|
Shadow(
|
|
|
|
offset: Offset(0.0, 0.0),
|
|
|
|
blurRadius: 8.0,
|
|
|
|
color: Colors.black,
|
|
|
|
),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
textAlign: TextAlign.end,
|
|
|
|
),
|
|
|
|
)),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
class CompareBoolThingy extends StatelessWidget {
|
|
|
|
final bool greenSide;
|
|
|
|
final bool redSide;
|
|
|
|
final String label;
|
|
|
|
final bool trueIsBetter;
|
2023-06-19 20:42:37 +00:00
|
|
|
const CompareBoolThingy(
|
|
|
|
{super.key,
|
|
|
|
required this.greenSide,
|
|
|
|
required this.redSide,
|
|
|
|
required this.label,
|
|
|
|
required this.trueIsBetter});
|
2023-06-17 21:50:52 +00:00
|
|
|
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
return Padding(
|
|
|
|
padding: const EdgeInsets.fromLTRB(16, 2, 16, 2),
|
|
|
|
child: Row(children: [
|
|
|
|
Expanded(
|
|
|
|
child: Container(
|
|
|
|
padding: const EdgeInsets.all(4),
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
gradient: LinearGradient(
|
|
|
|
colors: const [Colors.green, Colors.transparent],
|
|
|
|
begin: Alignment.centerLeft,
|
|
|
|
end: Alignment.centerRight,
|
|
|
|
stops: [
|
|
|
|
0.0,
|
|
|
|
trueIsBetter
|
|
|
|
? greenSide
|
|
|
|
? 0.6
|
|
|
|
: 0
|
|
|
|
: !greenSide
|
|
|
|
? 0.6
|
|
|
|
: 0
|
|
|
|
],
|
|
|
|
)),
|
|
|
|
child: Text(
|
2023-07-14 20:21:49 +00:00
|
|
|
greenSide ? t.yes : t.no,
|
2023-06-17 21:50:52 +00:00
|
|
|
style: const TextStyle(
|
|
|
|
fontSize: 22,
|
|
|
|
shadows: <Shadow>[
|
|
|
|
Shadow(
|
|
|
|
offset: Offset(0.0, 0.0),
|
|
|
|
blurRadius: 3.0,
|
|
|
|
color: Colors.black,
|
|
|
|
),
|
|
|
|
Shadow(
|
|
|
|
offset: Offset(0.0, 0.0),
|
|
|
|
blurRadius: 8.0,
|
|
|
|
color: Colors.black,
|
|
|
|
),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
textAlign: TextAlign.start,
|
|
|
|
),
|
|
|
|
)),
|
|
|
|
Column(
|
|
|
|
children: [
|
|
|
|
Text(
|
|
|
|
label,
|
|
|
|
style: const TextStyle(fontSize: 22),
|
|
|
|
textAlign: TextAlign.center,
|
|
|
|
),
|
2024-03-02 22:26:31 +00:00
|
|
|
const Text("---", style: verdictStyle, textAlign: TextAlign.center)
|
2023-06-17 21:50:52 +00:00
|
|
|
],
|
|
|
|
),
|
|
|
|
Expanded(
|
|
|
|
child: Container(
|
|
|
|
padding: const EdgeInsets.all(4),
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
gradient: LinearGradient(
|
|
|
|
colors: const [Colors.red, Colors.transparent],
|
|
|
|
begin: Alignment.centerRight,
|
|
|
|
end: Alignment.centerLeft,
|
|
|
|
stops: [
|
|
|
|
0.0,
|
|
|
|
trueIsBetter
|
|
|
|
? redSide
|
|
|
|
? 0.6
|
|
|
|
: 0
|
|
|
|
: !redSide
|
|
|
|
? 0.6
|
|
|
|
: 0
|
|
|
|
],
|
|
|
|
)),
|
|
|
|
child: Text(
|
2023-07-14 20:21:49 +00:00
|
|
|
redSide ? t.yes : t.no,
|
2023-06-17 21:50:52 +00:00
|
|
|
style: const TextStyle(
|
|
|
|
fontSize: 22,
|
|
|
|
shadows: <Shadow>[
|
|
|
|
Shadow(
|
|
|
|
offset: Offset(0.0, 0.0),
|
|
|
|
blurRadius: 3.0,
|
|
|
|
color: Colors.black,
|
|
|
|
),
|
|
|
|
Shadow(
|
|
|
|
offset: Offset(0.0, 0.0),
|
|
|
|
blurRadius: 8.0,
|
|
|
|
color: Colors.black,
|
|
|
|
),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
textAlign: TextAlign.end,
|
|
|
|
),
|
|
|
|
)),
|
|
|
|
]),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
class CompareDurationThingy extends StatelessWidget {
|
|
|
|
final Duration greenSide;
|
|
|
|
final Duration redSide;
|
|
|
|
final String label;
|
|
|
|
final bool higherIsBetter;
|
2023-06-19 20:42:37 +00:00
|
|
|
const CompareDurationThingy(
|
|
|
|
{super.key,
|
|
|
|
required this.greenSide,
|
|
|
|
required this.redSide,
|
|
|
|
required this.label,
|
|
|
|
required this.higherIsBetter});
|
2023-06-17 21:50:52 +00:00
|
|
|
|
|
|
|
Duration verdict(Duration greenSide, Duration redSide) {
|
|
|
|
return greenSide - redSide;
|
|
|
|
}
|
|
|
|
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
return Padding(
|
|
|
|
padding: const EdgeInsets.fromLTRB(16, 2, 16, 2),
|
|
|
|
child: Row(
|
|
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
children: [
|
2024-08-20 17:17:59 +00:00
|
|
|
Expanded(child: Container(
|
|
|
|
padding: const EdgeInsets.all(4),
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
gradient: LinearGradient(
|
|
|
|
colors: const [Colors.green, Colors.transparent],
|
|
|
|
begin: Alignment.centerLeft,
|
|
|
|
end: Alignment.centerRight,
|
|
|
|
transform: const GradientRotation(0.6),
|
|
|
|
stops: [
|
|
|
|
0.0,
|
|
|
|
higherIsBetter
|
|
|
|
? greenSide > redSide
|
|
|
|
? 0.6
|
|
|
|
: 0
|
|
|
|
: greenSide < redSide
|
|
|
|
? 0.6
|
|
|
|
: 0
|
|
|
|
],
|
|
|
|
)
|
2023-06-17 21:50:52 +00:00
|
|
|
),
|
2024-08-20 17:17:59 +00:00
|
|
|
child: Text(get40lTime(greenSide.inMicroseconds), style: const TextStyle(
|
|
|
|
fontSize: 22,
|
|
|
|
shadows: <Shadow>[
|
|
|
|
Shadow(
|
|
|
|
offset: Offset(0.0, 0.0),
|
|
|
|
blurRadius: 3.0,
|
|
|
|
color: Colors.black,
|
|
|
|
),
|
|
|
|
Shadow(
|
|
|
|
offset: Offset(0.0, 0.0),
|
|
|
|
blurRadius: 8.0,
|
|
|
|
color: Colors.black,
|
|
|
|
),
|
|
|
|
],
|
|
|
|
), textAlign: TextAlign.start)
|
|
|
|
)),
|
2023-06-17 21:50:52 +00:00
|
|
|
Column(
|
|
|
|
children: [
|
|
|
|
Text(
|
|
|
|
label,
|
|
|
|
style: const TextStyle(
|
|
|
|
fontSize: 22,
|
|
|
|
shadows: <Shadow>[
|
|
|
|
Shadow(
|
|
|
|
offset: Offset(0.0, 0.0),
|
|
|
|
blurRadius: 3.0,
|
|
|
|
color: Colors.black,
|
|
|
|
),
|
|
|
|
Shadow(
|
|
|
|
offset: Offset(0.0, 0.0),
|
|
|
|
blurRadius: 8.0,
|
|
|
|
color: Colors.black,
|
|
|
|
),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
textAlign: TextAlign.center,
|
|
|
|
),
|
|
|
|
Text(
|
2024-03-02 22:26:31 +00:00
|
|
|
verdict(greenSide, redSide).toString(), style: verdictStyle, textAlign: TextAlign.center)
|
2023-06-17 21:50:52 +00:00
|
|
|
],
|
|
|
|
),
|
2024-08-20 17:17:59 +00:00
|
|
|
Expanded(child: Container(
|
|
|
|
padding: const EdgeInsets.all(4),
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
gradient: LinearGradient(
|
|
|
|
colors: const [Colors.red, Colors.transparent],
|
|
|
|
begin: Alignment.centerRight,
|
|
|
|
end: Alignment.centerLeft,
|
|
|
|
transform: const GradientRotation(-0.6),
|
|
|
|
stops: [
|
|
|
|
0.0,
|
|
|
|
higherIsBetter
|
|
|
|
? redSide > greenSide
|
|
|
|
? 0.6
|
|
|
|
: 0
|
|
|
|
: redSide < greenSide
|
|
|
|
? 0.6
|
|
|
|
: 0
|
|
|
|
],
|
|
|
|
)),
|
|
|
|
child: Text(get40lTime(redSide.inMicroseconds), style: const TextStyle(
|
|
|
|
fontSize: 22,
|
|
|
|
shadows: <Shadow>[
|
|
|
|
Shadow(
|
|
|
|
offset: Offset(0.0, 0.0),
|
|
|
|
blurRadius: 3.0,
|
|
|
|
color: Colors.black,
|
|
|
|
),
|
|
|
|
Shadow(
|
|
|
|
offset: Offset(0.0, 0.0),
|
|
|
|
blurRadius: 8.0,
|
|
|
|
color: Colors.black,
|
|
|
|
),
|
|
|
|
],
|
|
|
|
), textAlign: TextAlign.end)
|
|
|
|
)),
|
2023-06-17 21:50:52 +00:00
|
|
|
],
|
|
|
|
),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
class CompareRegTimeThingy extends StatelessWidget {
|
|
|
|
final DateTime? greenSide;
|
|
|
|
final DateTime? redSide;
|
|
|
|
final String label;
|
|
|
|
final int? fractionDigits;
|
2023-06-19 20:42:37 +00:00
|
|
|
const CompareRegTimeThingy(
|
|
|
|
{super.key,
|
|
|
|
required this.greenSide,
|
|
|
|
required this.redSide,
|
|
|
|
required this.label,
|
|
|
|
this.fractionDigits});
|
2023-06-17 21:50:52 +00:00
|
|
|
|
|
|
|
String verdict(DateTime? greenSide, DateTime? redSide) {
|
2023-07-14 20:21:49 +00:00
|
|
|
var f = NumberFormat("#,### ${t.daysLater};#,### ${t.dayseBefore}");
|
2023-06-17 21:50:52 +00:00
|
|
|
String result = "---";
|
2023-06-23 18:38:15 +00:00
|
|
|
if (greenSide != null && redSide != null) {
|
2023-06-19 20:42:37 +00:00
|
|
|
result = f.format(greenSide.difference(redSide).inDays);
|
2023-06-23 18:38:15 +00:00
|
|
|
}
|
2023-06-17 21:50:52 +00:00
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
2023-07-15 16:22:25 +00:00
|
|
|
DateFormat f = DateFormat.yMMMd(LocaleSettings.currentLocale.languageCode);
|
2023-06-17 21:50:52 +00:00
|
|
|
return Padding(
|
|
|
|
padding: const EdgeInsets.fromLTRB(16, 2, 16, 2),
|
|
|
|
child: Row(
|
|
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
children: [
|
|
|
|
Expanded(
|
|
|
|
child: Container(
|
|
|
|
padding: const EdgeInsets.all(4),
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
gradient: LinearGradient(
|
|
|
|
colors: const [Colors.green, Colors.transparent],
|
|
|
|
begin: Alignment.centerLeft,
|
|
|
|
end: Alignment.centerRight,
|
|
|
|
stops: [
|
|
|
|
0.0,
|
|
|
|
greenSide == null
|
|
|
|
? 0.6
|
|
|
|
: redSide != null && greenSide!.isBefore(redSide!)
|
|
|
|
? 0.6
|
|
|
|
: 0
|
|
|
|
],
|
|
|
|
)),
|
|
|
|
child: Text(
|
2023-07-14 20:21:49 +00:00
|
|
|
greenSide != null ? f.format(greenSide!) : t.fromBeginning,
|
2023-06-17 21:50:52 +00:00
|
|
|
style: const TextStyle(
|
|
|
|
fontSize: 22,
|
|
|
|
shadows: <Shadow>[
|
|
|
|
Shadow(
|
|
|
|
offset: Offset(0.0, 0.0),
|
|
|
|
blurRadius: 3.0,
|
|
|
|
color: Colors.black,
|
|
|
|
),
|
|
|
|
Shadow(
|
|
|
|
offset: Offset(0.0, 0.0),
|
|
|
|
blurRadius: 8.0,
|
|
|
|
color: Colors.black,
|
|
|
|
),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
textAlign: TextAlign.start,
|
|
|
|
),
|
|
|
|
)),
|
|
|
|
Column(
|
|
|
|
children: [
|
|
|
|
Text(
|
|
|
|
label,
|
|
|
|
style: const TextStyle(fontSize: 22),
|
|
|
|
textAlign: TextAlign.center,
|
|
|
|
),
|
2024-03-02 22:26:31 +00:00
|
|
|
Text(verdict(greenSide, redSide), style: verdictStyle, textAlign: TextAlign.center)
|
2023-06-17 21:50:52 +00:00
|
|
|
],
|
|
|
|
),
|
|
|
|
Expanded(
|
|
|
|
child: Container(
|
|
|
|
padding: const EdgeInsets.all(4),
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
gradient: LinearGradient(
|
|
|
|
colors: const [Colors.red, Colors.transparent],
|
|
|
|
begin: Alignment.centerRight,
|
|
|
|
end: Alignment.centerLeft,
|
|
|
|
stops: [
|
|
|
|
0.0,
|
|
|
|
redSide == null
|
|
|
|
? 0.6
|
|
|
|
: greenSide != null && redSide!.isBefore(greenSide!)
|
|
|
|
? 0.6
|
|
|
|
: 0
|
|
|
|
],
|
|
|
|
)),
|
|
|
|
child: Text(
|
2023-07-14 20:21:49 +00:00
|
|
|
redSide != null ? f.format(redSide!) : t.fromBeginning,
|
2023-06-17 21:50:52 +00:00
|
|
|
style: const TextStyle(
|
|
|
|
fontSize: 22,
|
|
|
|
shadows: <Shadow>[
|
|
|
|
Shadow(
|
|
|
|
offset: Offset(0.0, 0.0),
|
|
|
|
blurRadius: 3.0,
|
|
|
|
color: Colors.black,
|
|
|
|
),
|
|
|
|
Shadow(
|
|
|
|
offset: Offset(0.0, 0.0),
|
|
|
|
blurRadius: 8.0,
|
|
|
|
color: Colors.black,
|
|
|
|
),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
textAlign: TextAlign.end,
|
|
|
|
),
|
|
|
|
)),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|