stupid hotfix

This commit is contained in:
dan63047 2023-06-14 16:34:23 +03:00
parent 5ea7f611c3
commit eb8f9a9da6
1 changed files with 17 additions and 9 deletions

View File

@ -3,6 +3,9 @@ import 'package:flutter/material.dart';
import 'package:intl/intl.dart'; import 'package:intl/intl.dart';
import 'package:tetra_stats/data_objects/tetrio.dart'; import 'package:tetra_stats/data_objects/tetrio.dart';
double? apm;
double? pps;
double? vs;
NerdStats? nerdStats; NerdStats? nerdStats;
EstTr? estTr; EstTr? estTr;
Playstyle? playstyle; Playstyle? playstyle;
@ -26,14 +29,19 @@ class CalcState extends State<CalcView> {
super.initState(); super.initState();
} }
@override
void dispose() {
super.dispose();
}
void calc() { void calc() {
double? apm = double.tryParse(apmController.text); apm = double.tryParse(apmController.text);
double? pps = double.tryParse(ppsController.text); pps = double.tryParse(ppsController.text);
double? vs = double.tryParse(vsController.text); vs = double.tryParse(vsController.text);
if (apm != null && pps != null && vs != null) { if (apm != null && pps != null && vs != null) {
nerdStats = NerdStats(apm, pps, vs); nerdStats = NerdStats(apm!, pps!, vs!);
estTr = EstTr(apm, pps, vs, 60.9, nerdStats!.app, nerdStats!.dss, nerdStats!.dsp, nerdStats!.gbe); estTr = EstTr(apm!, pps!, vs!, 60.9, nerdStats!.app, nerdStats!.dss, nerdStats!.dsp, nerdStats!.gbe);
playstyle = Playstyle(apm, pps, nerdStats!.app, nerdStats!.vsapm, nerdStats!.dsp, nerdStats!.gbe, estTr!.srarea, estTr!.statrank); playstyle = Playstyle(apm!, pps!, nerdStats!.app, nerdStats!.vsapm, nerdStats!.dsp, nerdStats!.gbe, estTr!.srarea, estTr!.statrank);
setState(() {}); setState(() {});
} else { } else {
ScaffoldMessenger.of(context).showSnackBar(const SnackBar(content: Text("Please, enter valid values"))); ScaffoldMessenger.of(context).showSnackBar(const SnackBar(content: Text("Please, enter valid values")));
@ -166,9 +174,9 @@ class CalcState extends State<CalcView> {
dataSets: [ dataSets: [
RadarDataSet( RadarDataSet(
dataEntries: [ dataEntries: [
RadarEntry(value: double.parse(apmController.text) * 1), RadarEntry(value: apm! * 1),
RadarEntry(value: double.parse(ppsController.text) * 45), RadarEntry(value: pps! * 45),
RadarEntry(value: double.parse(vsController.text) * 0.444), RadarEntry(value: vs! * 0.444),
RadarEntry(value: nerdStats!.app * 185), RadarEntry(value: nerdStats!.app * 185),
RadarEntry(value: nerdStats!.dss * 175), RadarEntry(value: nerdStats!.dss * 175),
RadarEntry(value: nerdStats!.dsp * 450), RadarEntry(value: nerdStats!.dsp * 450),