1.2.4 is ready
This commit is contained in:
parent
51e8362859
commit
6e1473c6fb
|
@ -25,7 +25,7 @@ void main() async {
|
|||
databaseFactory = databaseFactoryFfi;
|
||||
}
|
||||
WidgetsFlutterBinding.ensureInitialized();
|
||||
if (!Platform.isAndroid && !Platform.isIOS){
|
||||
if (!kIsWeb && !Platform.isAndroid && !Platform.isIOS){
|
||||
await WindowManager.instance.ensureInitialized();
|
||||
windowManager.waitUntilReadyToShow().then((_) async {
|
||||
await windowManager.setTitle('Tetra Stats');
|
||||
|
|
|
@ -57,7 +57,7 @@ class TetrioService extends DB {
|
|||
final Map<String, List<News>> _newsCache = {};
|
||||
final Map<String, Map<String, double?>> _topTRcache = {};
|
||||
final Map<String, TetraLeagueAlphaStream> _tlStreamsCache = {}; // i'm trying to respect oskware api It should look something like {"cached_until": TetrioPlayer}
|
||||
final client = UserAgentClient("package info thingy: ${packageInfo.version} (Tetra Stats v1.2.4 dev build)", http.Client());
|
||||
final client = UserAgentClient("Tetra Stats v${packageInfo.version} (dm @dan63047 if someone abuse that software)", http.Client());
|
||||
static final TetrioService _shared = TetrioService._sharedInstance();
|
||||
factory TetrioService() => _shared;
|
||||
late final StreamController<Map<String, List<TetrioPlayer>>> _tetrioStreamController;
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
import 'dart:io';
|
||||
import 'package:fl_chart/fl_chart.dart';
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
import 'package:tetra_stats/data_objects/tetrio.dart';
|
||||
|
@ -31,7 +32,7 @@ class CalcState extends State<CalcView> {
|
|||
@override
|
||||
void initState() {
|
||||
_scrollController = ScrollController();
|
||||
if (!Platform.isAndroid && !Platform.isIOS){
|
||||
if (!kIsWeb && !Platform.isAndroid && !Platform.isIOS){
|
||||
windowManager.getTitle().then((value) => oldWindowTitle = value);
|
||||
windowManager.setTitle("Tetra Stats: ${t.statsCalc}");
|
||||
}
|
||||
|
@ -40,7 +41,7 @@ class CalcState extends State<CalcView> {
|
|||
|
||||
@override
|
||||
void dispose() {
|
||||
if (!Platform.isAndroid && !Platform.isIOS) windowManager.setTitle(oldWindowTitle);
|
||||
if (!kIsWeb && !Platform.isAndroid && !Platform.isIOS) windowManager.setTitle(oldWindowTitle);
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
|
|
|
@ -44,7 +44,7 @@ class CompareState extends State<CompareView> {
|
|||
fetchGreenSide(widget.greenSide[0].userId);
|
||||
if (widget.redSide[0] != null) fetchRedSide(widget.redSide[0].userId);
|
||||
_scrollController = ScrollController();
|
||||
if (!Platform.isAndroid && !Platform.isIOS){
|
||||
if (!kIsWeb && !Platform.isAndroid && !Platform.isIOS){
|
||||
windowManager.getTitle().then((value) => oldWindowTitle = value);
|
||||
}
|
||||
super.initState();
|
||||
|
@ -56,7 +56,7 @@ class CompareState extends State<CompareView> {
|
|||
greenSideMode = Mode.player;
|
||||
theRedSide = [null, null, null];
|
||||
redSideMode = Mode.player;
|
||||
if (!Platform.isAndroid && !Platform.isIOS) windowManager.setTitle(oldWindowTitle);
|
||||
if (!kIsWeb && !Platform.isAndroid && !Platform.isIOS) windowManager.setTitle(oldWindowTitle);
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
|
|
|
@ -135,7 +135,7 @@ class _MainState extends State<MainView> with SingleTickerProviderStateMixin {
|
|||
}
|
||||
_searchFor = me.userId;
|
||||
setState((){_titleNickname = me.username;});
|
||||
if (!Platform.isAndroid && !Platform.isIOS) await windowManager.setTitle(widget.title);
|
||||
if (!kIsWeb && !Platform.isAndroid && !Platform.isIOS) await windowManager.setTitle(widget.title);
|
||||
late List<dynamic> requests;
|
||||
late TetraLeagueAlphaStream tlStream;
|
||||
late Map<String, dynamic> records;
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import 'dart:io';
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
import 'package:tetra_stats/services/tetrio_crud.dart';
|
||||
|
@ -23,7 +24,7 @@ class MatchesState extends State<MatchesView> {
|
|||
|
||||
@override
|
||||
void initState() {
|
||||
if (!Platform.isAndroid && !Platform.isIOS){
|
||||
if (!kIsWeb && !Platform.isAndroid && !Platform.isIOS){
|
||||
windowManager.getTitle().then((value) => oldWindowTitle = value);
|
||||
windowManager.setTitle("Tetra Stats: ${t.matchesViewTitle(nickname: widget.username)}");
|
||||
}
|
||||
|
@ -32,7 +33,7 @@ class MatchesState extends State<MatchesView> {
|
|||
|
||||
@override
|
||||
void dispose(){
|
||||
if (!Platform.isAndroid && !Platform.isIOS) windowManager.setTitle(oldWindowTitle);
|
||||
if (!kIsWeb && !Platform.isAndroid && !Platform.isIOS) windowManager.setTitle(oldWindowTitle);
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
import 'dart:io';
|
||||
import 'package:fl_chart/fl_chart.dart';
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
import 'package:tetra_stats/data_objects/tetrio.dart';
|
||||
|
@ -33,7 +34,7 @@ class RankState extends State<RankView> with SingleTickerProviderStateMixin {
|
|||
void initState() {
|
||||
_scrollController = ScrollController();
|
||||
_tabController = TabController(length: 6, vsync: this);
|
||||
if (!Platform.isAndroid && !Platform.isIOS){
|
||||
if (!kIsWeb && !Platform.isAndroid && !Platform.isIOS){
|
||||
windowManager.getTitle().then((value) => oldWindowTitle = value);
|
||||
windowManager.setTitle("Tetra Stats: ${widget.rank[1]["everyone"] ? t.everyoneAverages : t.rankAverages(rank: widget.rank[0].rank.toUpperCase())}");
|
||||
}
|
||||
|
@ -44,7 +45,7 @@ class RankState extends State<RankView> with SingleTickerProviderStateMixin {
|
|||
void dispose() {
|
||||
_tabController.dispose();
|
||||
_scrollController.dispose();
|
||||
if (!Platform.isAndroid && !Platform.isIOS) windowManager.setTitle(oldWindowTitle);
|
||||
if (!kIsWeb && !Platform.isAndroid && !Platform.isIOS) windowManager.setTitle(oldWindowTitle);
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import 'dart:io';
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
import 'package:tetra_stats/gen/strings.g.dart';
|
||||
|
@ -24,7 +25,7 @@ class RanksAverages extends State<RankAveragesView> {
|
|||
averages = value.averages;
|
||||
setState(() {});
|
||||
});
|
||||
if (!Platform.isAndroid && !Platform.isIOS){
|
||||
if (!kIsWeb && !Platform.isAndroid && !Platform.isIOS){
|
||||
windowManager.getTitle().then((value) => oldWindowTitle = value);
|
||||
windowManager.setTitle("Tetra Stats: ${t.rankAveragesViewTitle}");
|
||||
}
|
||||
|
@ -33,7 +34,7 @@ class RanksAverages extends State<RankAveragesView> {
|
|||
|
||||
@override
|
||||
void dispose() {
|
||||
if (!Platform.isAndroid && !Platform.isIOS) windowManager.setTitle(oldWindowTitle);
|
||||
if (!kIsWeb && !Platform.isAndroid && !Platform.isIOS) windowManager.setTitle(oldWindowTitle);
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@ class SettingsState extends State<SettingsView> {
|
|||
|
||||
@override
|
||||
void initState() {
|
||||
if (!Platform.isAndroid && !Platform.isIOS){
|
||||
if (!kIsWeb && !Platform.isAndroid && !Platform.isIOS){
|
||||
windowManager.getTitle().then((value) => oldWindowTitle = value);
|
||||
windowManager.setTitle("Tetra Stats: ${t.settings}");
|
||||
}
|
||||
|
@ -39,7 +39,7 @@ class SettingsState extends State<SettingsView> {
|
|||
|
||||
@override
|
||||
void dispose(){
|
||||
if (!Platform.isAndroid && !Platform.isIOS) windowManager.setTitle(oldWindowTitle);
|
||||
if (!kIsWeb && !Platform.isAndroid && !Platform.isIOS) windowManager.setTitle(oldWindowTitle);
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import 'dart:io';
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
import 'package:tetra_stats/data_objects/tetrio.dart';
|
||||
|
@ -25,7 +26,7 @@ class StateState extends State<StateView> {
|
|||
@override
|
||||
void initState() {
|
||||
_scrollController = ScrollController();
|
||||
if (!Platform.isAndroid && !Platform.isIOS){
|
||||
if (!kIsWeb && !Platform.isAndroid && !Platform.isIOS){
|
||||
windowManager.getTitle().then((value) => oldWindowTitle = value);
|
||||
windowManager.setTitle("Tetra Stats: ${t.stateViewTitle(nickname: widget.state.username.toUpperCase(), date: dateFormat.format(widget.state.state))}");
|
||||
}
|
||||
|
@ -35,7 +36,7 @@ class StateState extends State<StateView> {
|
|||
@override
|
||||
void dispose() {
|
||||
_scrollController.dispose();
|
||||
if (!Platform.isAndroid && !Platform.isIOS) windowManager.setTitle(oldWindowTitle);
|
||||
if (!kIsWeb && !Platform.isAndroid && !Platform.isIOS) windowManager.setTitle(oldWindowTitle);
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import 'dart:io';
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
import 'package:tetra_stats/data_objects/tetrio.dart';
|
||||
|
@ -20,7 +21,7 @@ late String oldWindowTitle;
|
|||
class StatesState extends State<StatesView> {
|
||||
@override
|
||||
void initState() {
|
||||
if (!Platform.isAndroid && !Platform.isIOS){
|
||||
if (!kIsWeb && !Platform.isAndroid && !Platform.isIOS){
|
||||
windowManager.getTitle().then((value) => oldWindowTitle = value);
|
||||
windowManager.setTitle("Tetra Stats: ${t.statesViewTitle(number: widget.states.length, nickname: widget.states.last.username.toUpperCase())}");
|
||||
}
|
||||
|
@ -29,7 +30,7 @@ class StatesState extends State<StatesView> {
|
|||
|
||||
@override
|
||||
void dispose() {
|
||||
if (!Platform.isAndroid && !Platform.isIOS) windowManager.setTitle(oldWindowTitle);
|
||||
if (!kIsWeb && !Platform.isAndroid && !Platform.isIOS) windowManager.setTitle(oldWindowTitle);
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import 'dart:io';
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
import 'package:tetra_stats/data_objects/tetrio.dart';
|
||||
|
@ -27,16 +28,13 @@ class TLLeaderboardView extends StatefulWidget {
|
|||
class TLLeaderboardState extends State<TLLeaderboardView> {
|
||||
@override
|
||||
void initState() {
|
||||
if (!Platform.isAndroid && !Platform.isIOS){
|
||||
windowManager.getTitle().then((value) => oldWindowTitle = value);
|
||||
windowManager.setTitle("Tetra Stats: ${t.tlLeaderboard}");
|
||||
}
|
||||
if (!kIsWeb && !Platform.isAndroid && !Platform.isIOS) windowManager.getTitle().then((value) => oldWindowTitle = value);
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
if (!Platform.isAndroid && !Platform.isIOS) windowManager.setTitle(oldWindowTitle);
|
||||
if (!kIsWeb && !Platform.isAndroid && !Platform.isIOS) windowManager.setTitle(oldWindowTitle);
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
|
@ -75,6 +73,7 @@ class TLLeaderboardState extends State<TLLeaderboardView> {
|
|||
return const Center(child: Text('Fetching...'));
|
||||
case ConnectionState.done:
|
||||
final allPlayers = snapshot.data?.getStatRanking(snapshot.data!.leaderboard, sortBy, reversed: reversed, country: country);
|
||||
if (!kIsWeb && !Platform.isAndroid && !Platform.isIOS) windowManager.setTitle("Tetra Stats: ${t.tlLeaderboard} - ${t.players(n: allPlayers!.length)}");
|
||||
return NestedScrollView(
|
||||
headerSliverBuilder: (context, value) {
|
||||
String howManyPlayers(int numberOfPlayers) => Intl.plural(
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
import 'dart:io';
|
||||
import 'package:fl_chart/fl_chart.dart';
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
import 'package:tetra_stats/data_objects/tetrio.dart';
|
||||
|
@ -30,7 +31,7 @@ class TlMatchResultState extends State<TlMatchResultView> {
|
|||
_scrollController = ScrollController();
|
||||
rounds = [DropdownMenuItem(value: -1, child: Text(t.match))];
|
||||
rounds.addAll([for (int i = 0; i < widget.record.endContext.first.secondaryTracking.length; i++) DropdownMenuItem(value: i, child: Text(t.roundNumber(n: i+1)))]);
|
||||
if (!Platform.isAndroid && !Platform.isIOS){
|
||||
if (!kIsWeb && !Platform.isAndroid && !Platform.isIOS){
|
||||
windowManager.getTitle().then((value) => oldWindowTitle = value);
|
||||
windowManager.setTitle("Tetra Stats: ${widget.record.endContext.firstWhere((element) => element.userId == widget.initPlayerId).username.toUpperCase()} ${t.vs} ${widget.record.endContext.firstWhere((element) => element.userId != widget.initPlayerId).username.toUpperCase()} ${t.inTLmatch} ${dateFormat.format(widget.record.timestamp)}");
|
||||
}
|
||||
|
@ -40,7 +41,7 @@ class TlMatchResultState extends State<TlMatchResultView> {
|
|||
@override
|
||||
void dispose(){
|
||||
roundSelector = -1;
|
||||
if (!Platform.isAndroid && !Platform.isIOS) windowManager.setTitle(oldWindowTitle);
|
||||
if (!kIsWeb && !Platform.isAndroid && !Platform.isIOS) windowManager.setTitle(oldWindowTitle);
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import 'dart:io';
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
import 'package:tetra_stats/data_objects/tetrio.dart';
|
||||
|
@ -20,7 +21,7 @@ class TrackedPlayersView extends StatefulWidget {
|
|||
class TrackedPlayersState extends State<TrackedPlayersView> {
|
||||
@override
|
||||
void initState() {
|
||||
if (!Platform.isAndroid && !Platform.isIOS){
|
||||
if (!kIsWeb && !Platform.isAndroid && !Platform.isIOS){
|
||||
windowManager.getTitle().then((value) => oldWindowTitle = value);
|
||||
windowManager.setTitle("Tetra Stats: ${t.trackedPlayersViewTitle}");
|
||||
}
|
||||
|
@ -29,7 +30,7 @@ class TrackedPlayersState extends State<TrackedPlayersView> {
|
|||
|
||||
@override
|
||||
void dispose() {
|
||||
if (!Platform.isAndroid && !Platform.isIOS) windowManager.setTitle(oldWindowTitle);
|
||||
if (!kIsWeb && !Platform.isAndroid && !Platform.isIOS) windowManager.setTitle(oldWindowTitle);
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
|
|
|
@ -55,9 +55,15 @@ class TLThingy extends StatelessWidget {
|
|||
Colors.green
|
||||
),
|
||||
),
|
||||
Text(
|
||||
"${t.top} ${f2.format(tl.percentile * 100)}% (${tl.percentileRank.toUpperCase()})${tl.bestRank != "z" ? " • ${t.topRank}: ${tl.bestRank.toUpperCase()}" : ""}${topTR != null ? " (${f2.format(topTR)} TR)" : ""} • Glicko: ${f2.format(tl.glicko!)}±${f2.format(tl.rd!)}${tl.decaying ? ' • ${t.decaying}' : ''}",
|
||||
textAlign: TextAlign.center,
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text(
|
||||
"${t.top} ${f2.format(tl.percentile * 100)}% (${tl.percentileRank.toUpperCase()})${tl.bestRank != "z" ? " • ${t.topRank}: ${tl.bestRank.toUpperCase()}" : ""}${topTR != null ? " (${f2.format(topTR)} TR)" : ""} • Glicko: ${f2.format(tl.glicko!)}±${f2.format(tl.rd!)}",
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
if (tl.decaying) Icon(Icons.trending_up, color: tl.rd! > 98 ? Colors.red : Colors.yellow,)
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
|
|
|
@ -2,7 +2,7 @@ name: tetra_stats
|
|||
description: Track your and other player stats in TETR.IO
|
||||
publish_to: 'none'
|
||||
|
||||
version: 1.2.3+11
|
||||
version: 1.2.4+12
|
||||
|
||||
environment:
|
||||
sdk: '>=2.19.6 <3.0.0'
|
||||
|
|
Loading…
Reference in New Issue