diff --git a/lib/services/tetrio_crud.dart b/lib/services/tetrio_crud.dart index 1d2f170..592dfaf 100644 --- a/lib/services/tetrio_crud.dart +++ b/lib/services/tetrio_crud.dart @@ -35,7 +35,7 @@ import 'package:tetra_stats/services/sqlite_db_controller.dart'; import 'package:csv/csv.dart'; const String dbName = "TetraStats.db"; -const String webVersionDomain = "ts.dan63.by"; +const String webVersionDomain = "tsbeta.dan63.by"; const String tetrioUsersTable = "tetrioUsers"; const String tetrioUsersToTrackTable = "tetrioUsersToTrack"; const String tetraLeagueMatchesTable = "tetrioAlphaLeagueMathces"; diff --git a/lib/views/compare_view_tiles.dart b/lib/views/compare_view_tiles.dart index 465c581..1c9644b 100644 --- a/lib/views/compare_view_tiles.dart +++ b/lib/views/compare_view_tiles.dart @@ -746,11 +746,8 @@ class CompareState extends State { await addRankAverages(nickname.substring(4).toLowerCase()); return null; }else{ - late TetrioPlayer player; - late Summaries summary; - List requests = await Future.wait([teto.fetchPlayer(nickname), teto.fetchSummaries(players.last.userId)]); - player = requests[0]; - summary = requests[1]; + TetrioPlayer player = await teto.fetchPlayer(nickname); + Summaries summary = await teto.fetchSummaries(player.userId); players.add(player); summaries.add(summary); addvaluesEntrys(players.last, summaries.last); @@ -848,103 +845,105 @@ class CompareState extends State { ), body: SafeArea( child: SingleChildScrollView( - child: SingleChildScrollView( - scrollDirection: Axis.horizontal, - controller: _scrollController, - physics: const AlwaysScrollableScrollPhysics(), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Center( + child: SingleChildScrollView( + scrollDirection: Axis.horizontal, + controller: _scrollController, + physics: const AlwaysScrollableScrollPhysics(), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, children: [ - SizedBox( - height: 175.0, - width: 300.0, - child: Card( - child: Padding( - padding: const EdgeInsets.fromLTRB(90.0, 18.0, 5.0, 0), - child: Text(t.comparison, style: TextStyle(fontSize: 28)), + Row( + children: [ + SizedBox( + height: 175.0, + width: 300.0, + child: Card( + child: Padding( + padding: const EdgeInsets.fromLTRB(18.0, 120.0, 5.0, 0), + child: Text(t.comparison, style: TextStyle(fontSize: 28)), + ), ), ), - ), - for (var p in players) SizedBox( - width: 300.0, - child: HeaderCard(p, removePlayer), - ), - SizedBox(width: 300, child: AddNewColumnCard(addPlayer)) - ] - ), - if (tlOnly) SizedBox( - width: 300+300*summaries.length.toDouble(), - child: Column( - children: [ - Row( - children: [ - SizedBox( - width: 300.0, - child: Card( - child: Column(children: [ - for (String title in TitesForStats[TitesForStats.keys.elementAt(1)]!) Text(title), - ]), - ), - ), - for (int k = 0; k < formattedValues[1].length; k++) SizedBox( - width: 300.0, - child: Card( - child: Column( - mainAxisSize: MainAxisSize.min, - children: [ - for (int l = 0; l < formattedValues[1][k].length; l++) Container(decoration: (rawValues[1].length > 1 && rawValues[1][k][l] != null && best[1][l] == rawValues[1][k][l]) ? BoxDecoration(boxShadow: [BoxShadow(color: Colors.cyanAccent.withAlpha(96), spreadRadius: 0, blurRadius: 4)]) : null, child: formattedValues[1][k][l]), - ], + for (var p in players) SizedBox( + width: 300.0, + child: HeaderCard(p, removePlayer), + ), + SizedBox(width: 300, child: AddNewColumnCard(addPlayer)) + ] + ), + if (tlOnly) SizedBox( + width: 300+300*summaries.length.toDouble(), + child: Column( + children: [ + Row( + children: [ + SizedBox( + width: 300.0, + child: Card( + child: Column(children: [ + for (String title in TitesForStats[TitesForStats.keys.elementAt(1)]!) Text(title), + ]), ), ), - ), - ] - ), - VsGraphs(stats: [for (var s in summaries) if (s.league.nerdStats != null) AggregateStats.precalculated(s.league.apm!, s.league.pps!, s.league.vs!, s.league.nerdStats!, s.league.playstyle!)], nicknames: [for (int i = 0; i < summaries.length; i++) if (summaries[i].league.nerdStats != null) nicknames[i]]), - ], - ), - ) - else for (int i = 0; i < formattedValues.length; i++) SizedBox( - width: 300+300*summaries.length.toDouble(), - child: ExpansionTile( - title: Text(TitesForStats.keys.elementAt(i), style: _expansionTileTitleTextStyle), - children: [ - Row( - children: [ - SizedBox( - width: 300.0, - child: Card( - child: Column(children: [ - for (String title in TitesForStats[TitesForStats.keys.elementAt(i)]!) Text(title), - ]), - ), - ), - for (int k = 0; k < formattedValues[i].length; k++) SizedBox( - width: 300.0, - child: Card( - child: Column( - mainAxisSize: MainAxisSize.min, - children: [ - for (int l = 0; l < formattedValues[i][k].length; l++) Container(decoration: (rawValues[0].length > 1 && rawValues[i][k][l] != null && best[i][l] == rawValues[i][k][l]) ? BoxDecoration(boxShadow: [BoxShadow(color: Colors.cyanAccent.withAlpha(96), spreadRadius: 0, blurRadius: 4)]) : null, child: formattedValues[i][k][l]), - ], + for (int k = 0; k < formattedValues[1].length; k++) SizedBox( + width: 300.0, + child: Card( + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + for (int l = 0; l < formattedValues[1][k].length; l++) Container(decoration: (rawValues[1].length > 1 && rawValues[1][k][l] != null && best[1][l] == rawValues[1][k][l]) ? BoxDecoration(boxShadow: [BoxShadow(color: Colors.cyanAccent.withAlpha(96), spreadRadius: 0, blurRadius: 4)]) : null, child: formattedValues[1][k][l]), + ], + ), ), ), - ), - ] - ), - if (i == 1) VsGraphs(stats: [for (var s in summaries) if (s.league.nerdStats != null) AggregateStats.precalculated(s.league.apm!, s.league.pps!, s.league.vs!, s.league.nerdStats!, s.league.playstyle!)], nicknames: [for (int i = 0; i < summaries.length; i++) if (summaries[i].league.nerdStats != null) nicknames[i]]), - if (i == 2) VsGraphs(stats: [for (var s in summaries) if ((s.zenith != null || s.zenithCareerBest != null) && (s.zenith?.aggregateStats??s.zenithCareerBest!.aggregateStats).apm > 0.00) s.zenith?.aggregateStats??s.zenithCareerBest!.aggregateStats], nicknames: [for (int i = 0; i < summaries.length; i++) if ((summaries[i].zenith != null || summaries[i].zenithCareerBest != null) && (summaries[i].zenith?.aggregateStats??summaries[i].zenithCareerBest!.aggregateStats).apm > 0.00) nicknames[i]]), - if (i == 3) VsGraphs(stats: [for (var s in summaries) if ((s.zenithEx != null || s.zenithExCareerBest != null) && (s.zenithEx?.aggregateStats??s.zenithExCareerBest!.aggregateStats).apm > 0.00) s.zenithEx?.aggregateStats??s.zenithExCareerBest!.aggregateStats], nicknames: [for (int i = 0; i < summaries.length; i++) if ((summaries[i].zenithEx != null || summaries[i].zenithExCareerBest != null) && (summaries[i].zenithEx?.aggregateStats??summaries[i].zenithExCareerBest!.aggregateStats).apm > 0.00) nicknames[i]]), - ], + ] + ), + VsGraphs(stats: [for (var s in summaries) if (s.league.nerdStats != null) AggregateStats.precalculated(s.league.apm!, s.league.pps!, s.league.vs!, s.league.nerdStats!, s.league.playstyle!)], nicknames: [for (int i = 0; i < summaries.length; i++) if (summaries[i].league.nerdStats != null) nicknames[i]]), + ], + ), + ) + else for (int i = 0; i < formattedValues.length; i++) SizedBox( + width: 300+300*summaries.length.toDouble(), + child: ExpansionTile( + title: Text(TitesForStats.keys.elementAt(i), style: _expansionTileTitleTextStyle), + children: [ + Row( + children: [ + SizedBox( + width: 300.0, + child: Card( + child: Column(children: [ + for (String title in TitesForStats[TitesForStats.keys.elementAt(i)]!) Text(title), + ]), + ), + ), + for (int k = 0; k < formattedValues[i].length; k++) SizedBox( + width: 300.0, + child: Card( + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + for (int l = 0; l < formattedValues[i][k].length; l++) Container(decoration: (rawValues[0].length > 1 && rawValues[i][k][l] != null && best[i][l] == rawValues[i][k][l]) ? BoxDecoration(boxShadow: [BoxShadow(color: Colors.cyanAccent.withAlpha(96), spreadRadius: 0, blurRadius: 4)]) : null, child: formattedValues[i][k][l]), + ], + ), + ), + ), + ] + ), + if (i == 1) VsGraphs(stats: [for (var s in summaries) if (s.league.nerdStats != null) AggregateStats.precalculated(s.league.apm!, s.league.pps!, s.league.vs!, s.league.nerdStats!, s.league.playstyle!)], nicknames: [for (int i = 0; i < summaries.length; i++) if (summaries[i].league.nerdStats != null) nicknames[i]]), + if (i == 2) VsGraphs(stats: [for (var s in summaries) if ((s.zenith != null || s.zenithCareerBest != null) && (s.zenith?.aggregateStats??s.zenithCareerBest!.aggregateStats).apm > 0.00) s.zenith?.aggregateStats??s.zenithCareerBest!.aggregateStats], nicknames: [for (int i = 0; i < summaries.length; i++) if ((summaries[i].zenith != null || summaries[i].zenithCareerBest != null) && (summaries[i].zenith?.aggregateStats??summaries[i].zenithCareerBest!.aggregateStats).apm > 0.00) nicknames[i]]), + if (i == 3) VsGraphs(stats: [for (var s in summaries) if ((s.zenithEx != null || s.zenithExCareerBest != null) && (s.zenithEx?.aggregateStats??s.zenithExCareerBest!.aggregateStats).apm > 0.00) s.zenithEx?.aggregateStats??s.zenithExCareerBest!.aggregateStats], nicknames: [for (int i = 0; i < summaries.length; i++) if ((summaries[i].zenithEx != null || summaries[i].zenithExCareerBest != null) && (summaries[i].zenithEx?.aggregateStats??summaries[i].zenithExCareerBest!.aggregateStats).apm > 0.00) nicknames[i]]), + ], + ), ), - ), - ]), - ], - ), + ]), + ), + ), + ], ), ), ), diff --git a/lib/views/destination_home.dart b/lib/views/destination_home.dart index f2ab957..d668c62 100644 --- a/lib/views/destination_home.dart +++ b/lib/views/destination_home.dart @@ -199,7 +199,7 @@ class ZenithCard extends StatelessWidget { mainAxisSize: MainAxisSize.min, crossAxisAlignment: CrossAxisAlignment.center, children: [ - Text(t.gamemodes["zenith"]!, style: Theme.of(context).textTheme.titleLarge), + Text(t.gamemodes["zenith"]!, style: width > 768.0 ? Theme.of(context).textTheme.titleLarge : Theme.of(context).textTheme.titleSmall), //Text("Leaderboard reset in ${countdown(postSeasonLeft)}", textAlign: TextAlign.center), ], ), @@ -238,10 +238,16 @@ class ZenithCard extends StatelessWidget { splitsCard(), ], ), - if (record != null) Card(child: Center(child: Text(t.nerdStats, style: Theme.of(context).textTheme.titleLarge, textAlign: TextAlign.center))), + if (record != null) Card(child: Center(child: Padding( + padding: const EdgeInsets.only(bottom: 4.0), + child: Text(t.nerdStats, style: width > 768.0 ? Theme.of(context).textTheme.titleLarge : Theme.of(context).textTheme.titleSmall, textAlign: TextAlign.center), + ))), if (record != null) NerdStatsThingy(nerdStats: record!.aggregateStats.nerdStats, width: width), if (record != null) Graphs(record!.aggregateStats.apm, record!.aggregateStats.pps, record!.aggregateStats.vs, record!.aggregateStats.nerdStats, record!.aggregateStats.playstyle), - if (achievements.isNotEmpty) Card(child: Center(child: Text(t.relatedAchievements, style: Theme.of(context).textTheme.titleLarge, textAlign: TextAlign.center))), + if (achievements.isNotEmpty) Card(child: Center(child: Padding( + padding: const EdgeInsets.only(bottom: 4.0), + child: Text(t.relatedAchievements, style: width > 768.0 ? Theme.of(context).textTheme.titleLarge : Theme.of(context).textTheme.titleSmall, textAlign: TextAlign.center), + ))), if (achievements.isNotEmpty) Wrap( direction: Axis.horizontal, children: [ @@ -265,6 +271,7 @@ class RecordCard extends StatelessWidget { const RecordCard(this.record, this.achievements, this.betterThanRankAverage, this.closestAverage, this.betterThanClosestAverage, this.rank, {this.width = double.infinity}); Widget result(){ + TextStyle tableTextStyle = TextStyle(fontSize: width > 768.0 ? 21 : 18); return Card( child: Column( children: [ @@ -303,9 +310,9 @@ class RecordCard extends StatelessWidget { "blitz" => readableIntDifference(record!.stats.score, blitzAverages[rank]!), _ => record!.stats.score.toString() }, verdict: betterThanRankAverage??false ? t.verdictBetter : t.verdictWorse, rank: rank!.toUpperCase())}\n", style: TextStyle( - color: betterThanClosestAverage??false ? Colors.greenAccent : Colors.redAccent + color: betterThanRankAverage??false ? Colors.greenAccent : Colors.redAccent )) - else if ((rank == null || rank == "z" || rank == "x+") && closestAverage != null) TextSpan(text: "${t.verdictGeneral(n: switch(record!.gamemode){ + else if ((rank == null || rank == "z") && closestAverage != null) TextSpan(text: "${t.verdictGeneral(n: switch(record!.gamemode){ "40l" => readableTimeDifference(record!.stats.finalTime, closestAverage!.value), "blitz" => readableIntDifference(record!.stats.score, closestAverage!.value), _ => record!.stats.score.toString() @@ -337,17 +344,17 @@ class RecordCard extends StatelessWidget { "blitz" => record!.stats.level.toString(), "5mblast" => NumberFormat.decimalPattern().format(record!.stats.spp), _ => "What if " - }, textAlign: TextAlign.right, style: const TextStyle(fontSize: 21)), + }, textAlign: TextAlign.right, style: tableTextStyle), Text(switch(record!.gamemode){ "40l" => " ${t.stats.pieces.full}", "blitz" => " ${t.stats.level.full}", "5mblast" => " ${t.stats.spp.short}", _ => " i wanted to" - }, textAlign: TextAlign.left, style: const TextStyle(fontSize: 21)), + }, textAlign: TextAlign.left, style: tableTextStyle), ]), TableRow(children: [ - Text(f2.format(record!.stats.pps), textAlign: TextAlign.right, style: const TextStyle(fontSize: 21)), - Text(" ${t.stats.pps.short}", textAlign: TextAlign.left, style: TextStyle(fontSize: 21)), + Text(f2.format(record!.stats.pps), textAlign: TextAlign.right, style: tableTextStyle), + Text(" ${t.stats.pps.short}", textAlign: TextAlign.left, style: tableTextStyle), ]), TableRow(children: [ Text(switch(record!.gamemode){ @@ -355,13 +362,13 @@ class RecordCard extends StatelessWidget { "blitz" => f2.format(record!.stats.spp), "5mblast" => record!.stats.piecesPlaced.toString(), _ => "but god said" - }, textAlign: TextAlign.right, style: const TextStyle(fontSize: 21)), + }, textAlign: TextAlign.right, style: tableTextStyle), Text(switch(record!.gamemode){ "40l" => " ${t.stats.kpp.short}", "blitz" => " ${t.stats.spp.short}", "5mblast" => " ${t.stats.pieces.short}", _ => " no" - }, textAlign: TextAlign.left, style: const TextStyle(fontSize: 21)), + }, textAlign: TextAlign.left, style: tableTextStyle), ]) ], ), @@ -371,12 +378,12 @@ class RecordCard extends StatelessWidget { defaultColumnWidth:const IntrinsicColumnWidth(), children: [ TableRow(children: [ - Text(intf.format(record!.stats.inputs), textAlign: TextAlign.right, style: const TextStyle(fontSize: 21)), - Text(" ${t.stats.kp.short}", textAlign: TextAlign.left, style: TextStyle(fontSize: 21)), + Text(intf.format(record!.stats.inputs), textAlign: TextAlign.right, style: tableTextStyle), + Text(" ${t.stats.kp.short}", textAlign: TextAlign.left, style: tableTextStyle), ]), TableRow(children: [ - Text(f2.format(record!.stats.kps), textAlign: TextAlign.right, style: const TextStyle(fontSize: 21)), - Text(" ${t.stats.kps.short}", textAlign: TextAlign.left, style: TextStyle(fontSize: 21)), + Text(f2.format(record!.stats.kps), textAlign: TextAlign.right, style: tableTextStyle), + Text(" ${t.stats.kps.short}", textAlign: TextAlign.left, style: tableTextStyle), ]), TableRow(children: [ Text(switch(record!.gamemode){ @@ -384,13 +391,13 @@ class RecordCard extends StatelessWidget { "blitz" => record!.stats.piecesPlaced.toString(), "5mblast" => record!.stats.piecesPlaced.toString(), _ => "but god said" - }, textAlign: TextAlign.right, style: const TextStyle(fontSize: 21)), + }, textAlign: TextAlign.right, style: tableTextStyle), Text(switch(record!.gamemode){ "40l" => " ", "blitz" => " ${t.stats.pieces.short}", "5mblast" => " ${t.stats.pieces.short}", _ => " no" - }, textAlign: TextAlign.left, style: const TextStyle(fontSize: 21)), + }, textAlign: TextAlign.left, style: tableTextStyle), ]) ], ), @@ -767,7 +774,7 @@ class _DestinationHomeState extends State with SingleTickerProv children: [ Text(t.gamemodes['40l']!, style: Theme.of(context).textTheme.titleSmall, textAlign: TextAlign.center), const Divider(), - RecordSummary(record: summaries.sprint, betterThanClosestAverage: sprintBetterThanClosestAverage, betterThanRankAverage: sprintBetterThanRankAverage, closestAverage: closestAverageSprint, rank: summaries.league.percentileRank), + RecordSummary(record: summaries.sprint, betterThanClosestAverage: sprintBetterThanClosestAverage, betterThanRankAverage: sprintBetterThanRankAverage, closestAverage: closestAverageSprint, rank: summaries.league.rank), const Divider(), Text("${summaries.sprint != null ? intf.format(summaries.sprint!.stats.piecesPlaced) : "---"} P • ${summaries.sprint != null ? f2.format(summaries.sprint!.stats.pps) : "-.--"} PPS • ${summaries.sprint != null ? f2.format(summaries.sprint!.stats.kpp) : "-.--"} KPP", style: const TextStyle(color: Colors.grey), textAlign: TextAlign.center) ], @@ -782,7 +789,7 @@ class _DestinationHomeState extends State with SingleTickerProv children: [ Text(t.gamemodes['blitz']!, style: Theme.of(context).textTheme.titleSmall, textAlign: TextAlign.center), const Divider(), - RecordSummary(record: summaries.blitz, betterThanClosestAverage: blitzBetterThanClosestAverage, betterThanRankAverage: blitzBetterThanRankAverage, closestAverage: closestAverageBlitz, rank: summaries.league.percentileRank), + RecordSummary(record: summaries.blitz, betterThanClosestAverage: blitzBetterThanClosestAverage, betterThanRankAverage: blitzBetterThanRankAverage, closestAverage: closestAverageBlitz, rank: summaries.league.rank), const Divider(), Text("Level ${summaries.blitz != null ? intf.format(summaries.blitz!.stats.level): "--"} • ${summaries.blitz != null ? f2.format(summaries.blitz!.stats.spp) : "-.--"} SPP • ${summaries.blitz != null ? f2.format(summaries.blitz!.stats.pps) : "-.--"} PPS", style: const TextStyle(color: Colors.grey)) ], @@ -920,8 +927,11 @@ class _DestinationHomeState extends State with SingleTickerProv mainAxisSize: MainAxisSize.min, crossAxisAlignment: CrossAxisAlignment.center, children: [ - Text(t.gamemodes["league"]!, style: Theme.of(context).textTheme.titleLarge), - if (toCompare != null) Text(t.comparingWith(newDate: timestamp(toSee.timestamp), oldDate: timestamp(toCompare.timestamp)), textAlign: TextAlign.center) + Text(t.gamemodes["league"]!, style: widget.constraints.maxWidth > 768.0 ? Theme.of(context).textTheme.titleLarge : Theme.of(context).textTheme.titleSmall), + if (toCompare != null) Padding( + padding: const EdgeInsets.only(top: 4.0), + child: Text(t.comparingWith(newDate: timestamp(toSee.timestamp), oldDate: timestamp(toCompare.timestamp)), textAlign: TextAlign.center, style: widget.constraints.maxWidth > 768.0 ? null : TextStyle(fontSize: 12.0)), + ) ], ), ), @@ -938,10 +948,13 @@ class _DestinationHomeState extends State with SingleTickerProv // ) // ), // ), - if (data.nerdStats != null) Card(child: Center(child: Text(t.nerdStats, style: Theme.of(context).textTheme.titleLarge, textAlign: TextAlign.center))), + if (data.nerdStats != null) Card(child: Center(child: Padding( + padding: const EdgeInsets.only(bottom: 4.0), + child: Text(t.nerdStats, style: widget.constraints.maxWidth > 768.0 ? Theme.of(context).textTheme.titleLarge : Theme.of(context).textTheme.titleSmall, textAlign: TextAlign.center), + ))), if (data.nerdStats != null) NerdStatsThingy(nerdStats: toSee.nerdStats!, oldNerdStats: toCompare?.nerdStats, averages: averages, lbPos: lbPos, width: width), if (data.nerdStats != null) Graphs(toSee.apm!, toSee.pps!, toSee.vs!, toSee.nerdStats!, toSee.playstyle!), - Card(child: Center(child: Text(t.relatedAchievements, style: Theme.of(context).textTheme.titleLarge, textAlign: TextAlign.center))), + Card(child: Center(child: Text(t.relatedAchievements, style: widget.constraints.maxWidth > 768.0 ? Theme.of(context).textTheme.titleLarge : Theme.of(context).textTheme.titleSmall, textAlign: TextAlign.center))), Wrap( direction: Axis.horizontal, children: [ @@ -963,7 +976,7 @@ class _DestinationHomeState extends State with SingleTickerProv mainAxisSize: MainAxisSize.min, crossAxisAlignment: CrossAxisAlignment.center, children: [ - Text(t.previousSeasons, style: Theme.of(context).textTheme.titleLarge, textAlign: TextAlign.center), + Text(t.previousSeasons, style: widget.constraints.maxWidth > 768.0 ? Theme.of(context).textTheme.titleLarge : Theme.of(context).textTheme.titleSmall, textAlign: TextAlign.center), //Text("${t.seasonStarts} ${countdown(postSeasonLeft)}", textAlign: TextAlign.center) ], ), @@ -1122,7 +1135,7 @@ class _DestinationHomeState extends State with SingleTickerProv mainAxisSize: MainAxisSize.min, crossAxisAlignment: CrossAxisAlignment.center, children: [ - Text(t.recent, style: Theme.of(context).textTheme.titleLarge), + Text(t.recent, style: widget.constraints.maxWidth > 768.0 ? Theme.of(context).textTheme.titleLarge : Theme.of(context).textTheme.titleSmall), ], ), ), @@ -1190,8 +1203,8 @@ class _DestinationHomeState extends State with SingleTickerProv if (snapshot.hasError){ return FutureError(snapshot); } if (snapshot.hasData){ if (!snapshot.data!.success) return ErrorThingy(data: snapshot.data!); - blitzBetterThanRankAverage = (snapshot.data!.summaries!.league.rank != "z" && snapshot.data!.summaries!.blitz != null && snapshot.data!.summaries!.league.rank != "x+") ? snapshot.data!.summaries!.blitz!.stats.score > blitzAverages[snapshot.data!.summaries!.league.rank]! : null; - sprintBetterThanRankAverage = (snapshot.data!.summaries!.league.rank != "z" && snapshot.data!.summaries!.sprint != null && snapshot.data!.summaries!.league.rank != "x+") ? snapshot.data!.summaries!.sprint!.stats.finalTime < sprintAverages[snapshot.data!.summaries!.league.rank]! : null; + blitzBetterThanRankAverage = (snapshot.data!.summaries!.league.rank != "z" && snapshot.data!.summaries!.blitz != null) ? snapshot.data!.summaries!.blitz!.stats.score > blitzAverages[snapshot.data!.summaries!.league.rank]! : null; + sprintBetterThanRankAverage = (snapshot.data!.summaries!.league.rank != "z" && snapshot.data!.summaries!.sprint != null) ? snapshot.data!.summaries!.sprint!.stats.finalTime < sprintAverages[snapshot.data!.summaries!.league.rank]! : null; if (snapshot.data!.summaries!.sprint != null) { closestAverageSprint = sprintAverages.entries.singleWhere((element) => element.value == sprintAverages.values.reduce((a, b) => (a-snapshot.data!.summaries!.sprint!.stats.finalTime).abs() < (b -snapshot.data!.summaries!.sprint!.stats.finalTime).abs() ? a : b)); sprintBetterThanClosestAverage = snapshot.data!.summaries!.sprint!.stats.finalTime < closestAverageSprint!.value; @@ -1321,7 +1334,7 @@ class _DestinationHomeState extends State with SingleTickerProv ), ), ), - if (modeButtons[rightCard]!.length > 1) SegmentedButton( + if (modeButtons[rightCard]!.length > 1 && !widget.noSidebar) SegmentedButton( showSelectedIcon: false, selected: {cardMod}, segments: modeButtons[rightCard]!, @@ -1332,7 +1345,7 @@ class _DestinationHomeState extends State with SingleTickerProv }); }, ), - SegmentedButton( + if (!widget.noSidebar) SegmentedButton( showSelectedIcon: false, segments: >[ ButtonSegment( diff --git a/lib/views/main_view.dart b/lib/views/main_view.dart index 3a7f629..1763532 100644 --- a/lib/views/main_view.dart +++ b/lib/views/main_view.dart @@ -173,6 +173,8 @@ class _MainState extends State with TickerProviderStateMixin { Widget pickers(int destination){ return switch (destination) { 0 => Column( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.center, children: [ SingleChildScrollView( scrollDirection: Axis.horizontal, @@ -270,45 +272,41 @@ class _MainState extends State with TickerProviderStateMixin { Widget build(BuildContext context) { return LayoutBuilder( builder: (BuildContext context, BoxConstraints constraints){ - bool screenIsBig = constraints.maxWidth > 768.00; + bool screenIsBig = constraints.maxWidth > 1030.00; return Scaffold( key: _scaffoldKey, drawer: SearchDrawer(changePlayer: changePlayer, controller: _searchController), endDrawer: DestinationsDrawer(changeDestination: (value) {setState(() {destination = value;});}), - bottomNavigationBar: screenIsBig ? null : BottomAppBar( - shape: const AutomaticNotchedShape(RoundedRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(0.0))), RoundedRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(16.0)))), - notchMargin: 2.0, - height: 88, - child: IconTheme( - data: IconThemeData(color: Theme.of(context).colorScheme.primary), - child: Row( - children: [ - IconButton( - tooltip: t.navMenuTooltip, - icon: const Icon(Icons.menu), - onPressed: () { - _scaffoldKey.currentState!.openEndDrawer(); - }, - ), - Expanded( - child: pickers(destination), - ), - SizedBox( - width: 40.0, - ), - ], + persistentFooterButtons: screenIsBig ? null : [Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + IconButton.filled( + icon: const Icon(Icons.search), + style: IconButton.styleFrom( + visualDensity: VisualDensity(horizontal: 1.0, vertical: 1.0), + shape: RoundedRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(16.0))), + backgroundColor: Theme.of(context).colorScheme.primary, + fixedSize: Size(52, 52) + ), + onPressed: () { + _scaffoldKey.currentState!.openDrawer(); + _searchController.clear(); + }, ), - ), - ), - floatingActionButtonLocation: screenIsBig ? null : FloatingActionButtonLocation.endDocked, - floatingActionButton: screenIsBig ? null : FloatingActionButton( - elevation: 0, - onPressed: () { - _scaffoldKey.currentState!.openDrawer(); - _searchController.clear(); - }, - child: const Icon(Icons.search), - ), + IconButton( + onPressed: (){ + _scaffoldKey.currentState!.openEndDrawer(); + }, + style: IconButton.styleFrom( + visualDensity: VisualDensity(horizontal: 1.0, vertical: 1.0), + shape: RoundedRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(16.0))), + ), + icon: Icon(Icons.menu) + ), + Expanded(child: pickers(destination)), + ], + )], + persistentFooterAlignment: AlignmentDirectional.bottomCenter, body: SafeArea( child: Row( mainAxisAlignment: MainAxisAlignment.center, diff --git a/lib/widgets/tl_thingy.dart b/lib/widgets/tl_thingy.dart index f1adf6c..b676a55 100644 --- a/lib/widgets/tl_thingy.dart +++ b/lib/widgets/tl_thingy.dart @@ -24,30 +24,30 @@ class TetraLeagueThingy extends StatelessWidget{ List secondColumn(){ return [ TableRow(children: [ - Text(intf.format(league.gamesPlayed), textAlign: TextAlign.right, style: const TextStyle(fontSize: 21)), + Text(intf.format(league.gamesPlayed), textAlign: TextAlign.right, style: TextStyle(fontSize: width > 768.0 ? 21 : 18)), Tooltip( message: "${t.stats.gp.full}", - child: Text(" ${t.stats.gp.short}", style: TextStyle(fontSize: 21)) + child: Text(" ${t.stats.gp.short}", style: TextStyle(fontSize: width > 768.0 ? 21 : 18)) ), - if (toCompare != null) Text(" (${comparef2.format(league.gamesPlayed-toCompare!.gamesPlayed)})", textAlign: TextAlign.right, style: TextStyle(fontSize: 21, color: Colors.grey)), + if (toCompare != null) Text(" (${comparef2.format(league.gamesPlayed-toCompare!.gamesPlayed)})", textAlign: TextAlign.right, style: TextStyle(fontSize: width > 768.0 ? 21 : 18, color: Colors.grey)), if (lbPos != null) Text(lbPos?.gamesPlayed != null ? (lbPos!.gamesPlayed!.position >= 1000 ? " (${t.top} ${f2.format(lbPos!.gamesPlayed!.percentage*100)}%)" : " (№ ${lbPos!.gamesPlayed!.position})") : "(№ ---)", style: TextStyle(color: lbPos?.gamesPlayed != null ? getColorOfRank(lbPos!.gamesPlayed!.position) : null)) ]), TableRow(children: [ - Text(intf.format(league.gamesWon), textAlign: TextAlign.right, style: const TextStyle(fontSize: 21)), + Text(intf.format(league.gamesWon), textAlign: TextAlign.right, style: TextStyle(fontSize: width > 768.0 ? 21 : 18)), Tooltip( message: "${t.stats.gw.full}", - child: Text(" ${t.stats.gw.short}", style: TextStyle(fontSize: 21)) + child: Text(" ${t.stats.gw.short}", style: TextStyle(fontSize: width > 768.0 ? 21 : 18)) ), - if (toCompare != null) Text(" (${comparef2.format(league.gamesWon-toCompare!.gamesWon)})", textAlign: TextAlign.right, style: TextStyle(fontSize: 21, color: Colors.grey)), + if (toCompare != null) Text(" (${comparef2.format(league.gamesWon-toCompare!.gamesWon)})", textAlign: TextAlign.right, style: TextStyle(fontSize: width > 768.0 ? 21 : 18, color: Colors.grey)), if (lbPos != null) Text(lbPos?.gamesWon != null ? (lbPos!.gamesWon!.position >= 1000 ? " (${t.top} ${f2.format(lbPos!.gamesWon!.percentage*100)}%)" : " (№ ${lbPos!.gamesWon!.position})") : "(№ ---)", style: TextStyle(color: lbPos?.gamesWon != null ? getColorOfRank(lbPos!.gamesWon!.position) : null)) ]), TableRow(children: [ - Tooltip(child: Text("${league.gxe.isNegative ? "---" : f3.format(league.gxe)}", textAlign: TextAlign.right, style: TextStyle(fontSize: 21, color: league.gxe.isNegative ? Colors.grey : Colors.white)), message: "${f2.format(league.s1tr)} S1 TR"), + Tooltip(child: Text("${league.gxe.isNegative ? "---" : f3.format(league.gxe)}", textAlign: TextAlign.right, style: TextStyle(fontSize: width > 768.0 ? 21 : 18, color: league.gxe.isNegative ? Colors.grey : Colors.white)), message: "${f2.format(league.s1tr)} S1 TR"), Tooltip( message: "${t.stats.glixare.full}", - child: Tooltip(child: Text(" ${t.stats.glixare.short}", style: TextStyle(fontSize: 21, color: league.gxe.isNegative ? Colors.grey : Colors.white)), message: "Glixare") + child: Tooltip(child: Text(" ${t.stats.glixare.short}", style: TextStyle(fontSize: width > 768.0 ? 21 : 18, color: league.gxe.isNegative ? Colors.grey : Colors.white)), message: "Glixare") ), - if (toCompare != null) Text(" (${comparef.format(league.gxe-toCompare!.gxe)})", textAlign: TextAlign.right, style: TextStyle(fontSize: 21, color: getDifferenceColor(league.gxe-toCompare!.gxe))), + if (toCompare != null) Text(" (${comparef.format(league.gxe-toCompare!.gxe)})", textAlign: TextAlign.right, style: TextStyle(fontSize: width > 768.0 ? 21 : 18, color: getDifferenceColor(league.gxe-toCompare!.gxe))), if (lbPos != null) Text(lbPos?.glixare != null ? (lbPos!.glixare!.position >= 1000 ? " (${t.top} ${f2.format(lbPos!.glixare!.percentage*100)}%)" : " (№ ${lbPos!.glixare!.position})") : "(№ ---)", style: TextStyle(color: lbPos?.glixare != null ? getColorOfRank(lbPos!.glixare!.position) : null)) ]), ]; @@ -80,36 +80,36 @@ class TetraLeagueThingy extends StatelessWidget{ defaultColumnWidth:const IntrinsicColumnWidth(), children: [ TableRow(children: [ - Text(league.apm != null ? f2.format(league.apm) : "-.--", textAlign: TextAlign.right, style: TextStyle(fontSize: 21, color: league.apm != null ? getStatColor(league.apm!, averages?.apm, true) : Colors.grey)), + Text(league.apm != null ? f2.format(league.apm) : "-.--", textAlign: TextAlign.right, style: TextStyle(fontSize: width > 768.0 ? 21 : 18, color: league.apm != null ? getStatColor(league.apm!, averages?.apm, true) : Colors.grey)), Tooltip( message: "${t.stats.apm.full}${(averages != null) ? "\n${t.rankView.avgForRank(rank: league.percentileRank.toUpperCase())}: ${f2.format(averages!.apm)} ${t.stats.apm.short}" : ""}", - child: Text(" ${t.stats.apm.short}", style: TextStyle(fontSize: 21, color: league.apm != null ? getStatColor(league.apm!, averages?.apm, true) : Colors.grey)) + child: Text(" ${t.stats.apm.short}", style: TextStyle(fontSize: width > 768.0 ? 21 : 18, color: league.apm != null ? getStatColor(league.apm!, averages?.apm, true) : Colors.grey)) ), - if (toCompare != null) Text(" (${comparef2.format(league.apm!-toCompare!.apm!)})", textAlign: TextAlign.right, style: TextStyle(fontSize: 21, color: getDifferenceColor(league.apm!-toCompare!.apm!))), + if (toCompare != null) Text(" (${comparef2.format(league.apm!-toCompare!.apm!)})", textAlign: TextAlign.right, style: TextStyle(fontSize: width > 768.0 ? 21 : 18, color: getDifferenceColor(league.apm!-toCompare!.apm!))), if (lbPos != null) Text(lbPos?.apm != null ? (lbPos!.apm!.position >= 1000 ? " (${t.top} ${f2.format(lbPos!.apm!.percentage*100)}%)" : " (№ ${lbPos!.apm!.position})") : "(№ ---)", style: TextStyle(color: lbPos?.apm != null ? getColorOfRank(lbPos!.apm!.position) : null)) ]), TableRow(children: [ - Text(league.pps != null ? f2.format(league.pps) : "-.--", textAlign: TextAlign.right, style: TextStyle(fontSize: 21, color: league.pps != null ? getStatColor(league.pps!, averages?.pps, true) : Colors.grey)), + Text(league.pps != null ? f2.format(league.pps) : "-.--", textAlign: TextAlign.right, style: TextStyle(fontSize: width > 768.0 ? 21 : 18, color: league.pps != null ? getStatColor(league.pps!, averages?.pps, true) : Colors.grey)), Tooltip( message: "${t.stats.pps.full}${(averages != null) ? "\n${t.rankView.avgForRank(rank: league.percentileRank.toUpperCase())}: ${f2.format(averages!.pps)} ${t.stats.pps.short}" : ""}", - child: Text(" ${t.stats.pps.short}", style: TextStyle(fontSize: 21, color: league.pps != null ? getStatColor(league.pps!, averages?.pps, true) : Colors.grey)) + child: Text(" ${t.stats.pps.short}", style: TextStyle(fontSize: width > 768.0 ? 21 : 18, color: league.pps != null ? getStatColor(league.pps!, averages?.pps, true) : Colors.grey)) ), - if (toCompare != null) Text(" (${comparef2.format(league.pps!-toCompare!.pps!)})", textAlign: TextAlign.right, style: TextStyle(fontSize: 21, color: getDifferenceColor(league.pps!-toCompare!.pps!))), + if (toCompare != null) Text(" (${comparef2.format(league.pps!-toCompare!.pps!)})", textAlign: TextAlign.right, style: TextStyle(fontSize: width > 768.0 ? 21 : 18, color: getDifferenceColor(league.pps!-toCompare!.pps!))), if (lbPos != null) Text(lbPos?.pps != null ? (lbPos!.pps!.position >= 1000 ? " (${t.top} ${f2.format(lbPos!.pps!.percentage*100)}%)" : " (№ ${lbPos!.pps!.position})") : "(№ ---)", style: TextStyle(color: lbPos?.pps != null ? getColorOfRank(lbPos!.pps!.position) : null)) ]), TableRow(children: [ - Text(league.vs != null ? f2.format(league.vs) : "-.--", textAlign: TextAlign.right, style: TextStyle(fontSize: 21, color: league.vs != null ? getStatColor(league.vs!, averages?.vs, true) : Colors.grey)), + Text(league.vs != null ? f2.format(league.vs) : "-.--", textAlign: TextAlign.right, style: TextStyle(fontSize: width > 768.0 ? 21 : 18, color: league.vs != null ? getStatColor(league.vs!, averages?.vs, true) : Colors.grey)), Tooltip( message: "${t.stats.vs.full}${(averages != null) ? "\n${t.rankView.avgForRank(rank: league.percentileRank.toUpperCase())}: ${f2.format(averages!.vs)} ${t.stats.vs.short}" : ""}", - child: Text(" ${t.stats.vs.short}", style: TextStyle(fontSize: 21, color: league.vs != null ? getStatColor(league.vs!, averages?.vs, true) : Colors.grey)) + child: Text(" ${t.stats.vs.short}", style: TextStyle(fontSize: width > 768.0 ? 21 : 18, color: league.vs != null ? getStatColor(league.vs!, averages?.vs, true) : Colors.grey)) ), - if (toCompare != null) Text(" (${comparef2.format(league.vs!-toCompare!.vs!)})", textAlign: TextAlign.right, style: TextStyle(fontSize: 21, color: getDifferenceColor(league.vs!-toCompare!.vs!))), + if (toCompare != null) Text(" (${comparef2.format(league.vs!-toCompare!.vs!)})", textAlign: TextAlign.right, style: TextStyle(fontSize: width > 768.0 ? 21 : 18, color: getDifferenceColor(league.vs!-toCompare!.vs!))), if (lbPos != null) Text(lbPos?.vs != null ? (lbPos!.vs!.position >= 1000 ? " (${t.top} ${f2.format(lbPos!.vs!.percentage*100)}%)" : " (№ ${lbPos!.vs!.position})") : "(№ ---)", style: TextStyle(color: lbPos?.vs != null ? getColorOfRank(lbPos!.vs!.position) : null)) ]), if (width <= 600) TableRow(children: [ - Text(!league.winrate.isNegative ? percentage.format(league.winrate) : "---", textAlign: TextAlign.right, style: TextStyle(fontSize: 21, color: !league.winrate.isNegative ? Colors.white : Colors.grey)), - Text(" ${t.stats.winrate.short}", style: TextStyle(fontSize: 21, color: !league.winrate.isNegative ? Colors.white : Colors.grey)), - if (toCompare != null) Text(" (${comparef2.format((league.winrate-toCompare!.winrate)*100)})", textAlign: TextAlign.right, style: TextStyle(fontSize: 21, color: getDifferenceColor(league.winrate-toCompare!.winrate))), + Text(!league.winrate.isNegative ? percentage.format(league.winrate) : "---", textAlign: TextAlign.right, style: TextStyle(fontSize: width > 768.0 ? 21 : 18, color: !league.winrate.isNegative ? Colors.white : Colors.grey)), + Text(" ${t.stats.winrate.short}", style: TextStyle(fontSize: width > 768.0 ? 21 : 18, color: !league.winrate.isNegative ? Colors.white : Colors.grey)), + if (toCompare != null) Text(" (${comparef2.format((league.winrate-toCompare!.winrate)*100)})", textAlign: TextAlign.right, style: TextStyle(fontSize: width > 768.0 ? 21 : 18, color: getDifferenceColor(league.winrate-toCompare!.winrate))), if (lbPos != null) Text(lbPos?.winrate != null ? (lbPos!.winrate!.position >= 1000 ? " (${t.top} ${f2.format(lbPos!.winrate!.percentage*100)}%)" : " (№ ${lbPos!.winrate!.position})") : "(№ ---)", style: TextStyle(color: lbPos?.winrate != null ? getColorOfRank(lbPos!.winrate!.position) : null)) ]), if (width <= 400) ...secondColumn() diff --git a/lib/widgets/zenith_thingy.dart b/lib/widgets/zenith_thingy.dart index 55231bb..152d95b 100644 --- a/lib/widgets/zenith_thingy.dart +++ b/lib/widgets/zenith_thingy.dart @@ -14,50 +14,52 @@ class ZenithThingy extends StatelessWidget{ const ZenithThingy({super.key, required this.zenith, this.old = false, this.width = double.infinity}); - List secondColumn(){ + List secondColumn(TextStyle style){ return [ TableRow(children: [ - Text(intf.format(zenith!.stats.kills), textAlign: TextAlign.right, style: const TextStyle(fontSize: 21)), - Text(" ${t.stats.kos.short}", style: TextStyle(fontSize: 21)) + Text(intf.format(zenith!.stats.kills), textAlign: TextAlign.right, style: style), + Text(" ${t.stats.kos.short}", style: style) ]), TableRow(children: [ - Text(zenith!.stats.topBtB.toString(), textAlign: TextAlign.right, style: const TextStyle(fontSize: 21)), - Text(" ${t.stats.b2b.short}", style: TextStyle(fontSize: 21)) + Text(zenith!.stats.topBtB.toString(), textAlign: TextAlign.right, style: style), + Text(" ${t.stats.b2b.short}", style: style) ]), TableRow(children: [ - Text(zenith!.stats.garbage.maxspike_nomult.toString(), textAlign: TextAlign.right, style: const TextStyle(fontSize: 21)), - Text(" ${t.stats.spike}", style: TextStyle(fontSize: 21)) + Text(zenith!.stats.garbage.maxspike_nomult.toString(), textAlign: TextAlign.right, style: style), + Text(" ${t.stats.spike}", style: style) ]), if (width <= 600) TableRow(children: [ - Text(f2.format(zenith!.stats.zenith!.peakrank), textAlign: TextAlign.right, style: const TextStyle(fontSize: 21)), - Text(" ${t.stats.peakClimbSpeed.short}", style: TextStyle(fontSize: 21)), + Text(f2.format(zenith!.stats.zenith!.peakrank), textAlign: TextAlign.right, style: style), + Text(" ${t.stats.peakClimbSpeed.short}", style: style), ]) ]; } - List noRecordSecondColumn(){ + List noRecordSecondColumn(TextStyle style){ return [ TableRow(children: [ - Text("---", textAlign: TextAlign.right, style: TextStyle(fontSize: 21, color: Colors.grey)), - Text(" ${t.stats.kos.short}", style: TextStyle(fontSize: 21, color: Colors.grey)) + Text("---", textAlign: TextAlign.right, style: style), + Text(" ${t.stats.kos.short}", style: style) ]), TableRow(children: [ - Text("---", textAlign: TextAlign.right, style: TextStyle(fontSize: 21, color: Colors.grey)), - Text(" ${t.stats.b2b.short}", style: TextStyle(fontSize: 21, color: Colors.grey)) + Text("---", textAlign: TextAlign.right, style: style), + Text(" ${t.stats.b2b.short}", style: style) ]), TableRow(children: [ - Text("---", textAlign: TextAlign.right, style: TextStyle(fontSize: 21, color: Colors.grey)), - Text(" ${t.stats.spike}", style: TextStyle(fontSize: 21, color: Colors.grey)) + Text("---", textAlign: TextAlign.right, style: style), + Text(" ${t.stats.spike}", style: style) ]), if (width <= 600) TableRow(children: [ - Text("-.--", textAlign: TextAlign.right, style: const TextStyle(fontSize: 21, color: Colors.grey)), - Text(" ${t.stats.peakClimbSpeed.short}", style: TextStyle(fontSize: 21, color: Colors.grey)), + Text("-.--", textAlign: TextAlign.right, style: style), + Text(" ${t.stats.peakClimbSpeed.short}", style: style), ]) ]; } @override Widget build(BuildContext context) { + TextStyle tableTextStyle = TextStyle(fontSize: width > 768.0 ? 21 : 18); + TextStyle tableTextStyleMuted = TextStyle(fontSize: width > 768.0 ? 21 : 18, color: Colors.grey); return Card( child: Padding( padding: const EdgeInsets.fromLTRB(8.0, 0.0, 8.0, 0.0), @@ -108,22 +110,22 @@ class ZenithThingy extends StatelessWidget{ defaultColumnWidth:const IntrinsicColumnWidth(), children: [ TableRow(children: [ - Text(f2.format(zenith!.aggregateStats.apm), textAlign: TextAlign.right, style: const TextStyle(fontSize: 21)), - Text(" ${t.stats.apm.short}", style: TextStyle(fontSize: 21)), + Text(f2.format(zenith!.aggregateStats.apm), textAlign: TextAlign.right, style: tableTextStyle), + Text(" ${t.stats.apm.short}", style: tableTextStyle), ]), TableRow(children: [ - Text(f2.format(zenith!.aggregateStats.pps), textAlign: TextAlign.right, style: const TextStyle(fontSize: 21)), - Text(" ${t.stats.pps.short}", style: TextStyle(fontSize: 21)), + Text(f2.format(zenith!.aggregateStats.pps), textAlign: TextAlign.right, style: tableTextStyle), + Text(" ${t.stats.pps.short}", style: tableTextStyle), ]), TableRow(children: [ - Text(f2.format(zenith!.aggregateStats.vs), textAlign: TextAlign.right, style: const TextStyle(fontSize: 21)), - Text(" ${t.stats.vs.short}", style: TextStyle(fontSize: 21)), + Text(f2.format(zenith!.aggregateStats.vs), textAlign: TextAlign.right, style: tableTextStyle), + Text(" ${t.stats.vs.short}", style: tableTextStyle), ]), if (width <= 600) TableRow(children: [ - Text(f2.format(zenith!.stats.cps), textAlign: TextAlign.right, style: const TextStyle(fontSize: 21)), - Text(" ${t.stats.climbSpeed.short}", style: TextStyle(fontSize: 21)), + Text(f2.format(zenith!.stats.cps), textAlign: TextAlign.right, style: tableTextStyle), + Text(" ${t.stats.climbSpeed.short}", style: tableTextStyle), ]), - if (width <= 400) ...secondColumn().reversed + if (width <= 400) ...secondColumn(tableTextStyle).reversed ], ), ), @@ -133,7 +135,7 @@ class ZenithThingy extends StatelessWidget{ child: Center( child: Table( defaultColumnWidth:const IntrinsicColumnWidth(), - children: secondColumn(), + children: secondColumn(tableTextStyle), ), ), ) @@ -146,20 +148,20 @@ class ZenithThingy extends StatelessWidget{ defaultColumnWidth: IntrinsicColumnWidth(), children: [ TableRow(children: [ - Text("-.--", textAlign: TextAlign.right, style: TextStyle(fontSize: 21, color: Colors.grey)), - Text(" ${t.stats.apm.short}", style: TextStyle(fontSize: 21, color: Colors.grey)), + Text("-.--", textAlign: TextAlign.right, style: tableTextStyleMuted), + Text(" ${t.stats.apm.short}", style: tableTextStyleMuted), ]), TableRow(children: [ - Text("-.--", textAlign: TextAlign.right, style: TextStyle(fontSize: 21, color: Colors.grey)), - Text(" ${t.stats.pps.short}", style: TextStyle(fontSize: 21, color: Colors.grey)), + Text("-.--", textAlign: TextAlign.right, style: tableTextStyleMuted), + Text(" ${t.stats.pps.short}", style: tableTextStyleMuted), ]), TableRow(children: [ - Text("-.--", textAlign: TextAlign.right, style: TextStyle(fontSize: 21, color: Colors.grey)), - Text(" ${t.stats.vs.short}", style: TextStyle(fontSize: 21, color: Colors.grey)), + Text("-.--", textAlign: TextAlign.right, style: tableTextStyleMuted), + Text(" ${t.stats.vs.short}", style: tableTextStyleMuted), ]), if (width <= 600) TableRow(children: [ - Text("-.--", textAlign: TextAlign.right, style: const TextStyle(fontSize: 21, color: Colors.grey)), - Text(" ${t.stats.climbSpeed.short}", style: TextStyle(fontSize: 21, color: Colors.grey)), + Text("-.--", textAlign: TextAlign.right, style: tableTextStyleMuted), + Text(" ${t.stats.climbSpeed.short}", style: tableTextStyleMuted), ]) ], ), @@ -170,7 +172,7 @@ class ZenithThingy extends StatelessWidget{ child: Center( child: Table( defaultColumnWidth: IntrinsicColumnWidth(), - children: noRecordSecondColumn(), + children: noRecordSecondColumn(tableTextStyleMuted), ), ), ) diff --git a/pubspec.yaml b/pubspec.yaml index 483f070..ffffff0 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -2,7 +2,7 @@ name: tetra_stats description: Track your and other player stats in TETR.IO publish_to: 'none' -version: 2.0.0+41 +version: 2.0.1+42 environment: sdk: '>=3.0.0' diff --git a/web/index.html b/web/index.html index d3f6a1b..051a037 100644 --- a/web/index.html +++ b/web/index.html @@ -150,19 +150,20 @@ let tip = document.querySelector("#tip"); const tips = [ // Promoting Tetra Stats "native" - "Want a better perfomance?
Try out Tetra Stats \"Native\"", + "Did you know, that mobile browsers suck?
Fortunately, we have a solution", "Imagine a world, where Tetra Stats was written in JS", "Did you know, that Flutter for web sucks?", "Welcome to fullscreen canvas", // An actual tips "You can interact with most objects that have an accent color", - "Like Sheetbot graphs? Go to three dots menu → Settings → Customization", + "Like Sheetbot graphs? Go to Settings → Customization", "Click and hold on line chart graph, then start dragging to zoom in", "Discord userID ≠ Discord username. It should look like a bunch of digits", // :droidsmile: "Is she real?", + "Stats doesn't matter that much, you know...", "Check out wiki for more information" ]; tip.innerHTML = tips[Math.floor(Math.random() * tips.length)];