From cff370fa154b570dc54c2c3bcf2188d6bd6daa2e Mon Sep 17 00:00:00 2001 From: Chaoscaot Date: Mon, 26 Dec 2022 21:48:33 +0100 Subject: [PATCH] Another Fixes --- lib/src/provider/events.dart | 2 +- lib/src/provider/http.dart | 2 +- lib/src/screens/event.dart | 19 +++++++++++++++---- web/index.html | 2 +- 4 files changed, 18 insertions(+), 7 deletions(-) diff --git a/lib/src/provider/events.dart b/lib/src/provider/events.dart index 6484dac..6487dc6 100644 --- a/lib/src/provider/events.dart +++ b/lib/src/provider/events.dart @@ -46,7 +46,7 @@ class EventRepository { "start": start.millisecondsSinceEpoch, "end": end.millisecondsSinceEpoch, "maxTeamMembers": maxTeamMembers, - "schemType": schemType, + "schemType": schemType ?? "null", "publicSchemsOnly": publicOnly, "spectateSystem": useSpectateSystem, }); diff --git a/lib/src/provider/http.dart b/lib/src/provider/http.dart index ec7aa46..b587983 100644 --- a/lib/src/provider/http.dart +++ b/lib/src/provider/http.dart @@ -5,7 +5,7 @@ import 'package:steamwar_multitool/src/provider/user.dart'; final serverUrlProvider = Provider((ref) { if (kDebugMode) { - return "http://localhost:8000"; + return "http://localhost:1337"; } else { return "https://steamwar.de/eventplanner-api"; } diff --git a/lib/src/screens/event.dart b/lib/src/screens/event.dart index fa4f3c9..9ba2300 100644 --- a/lib/src/screens/event.dart +++ b/lib/src/screens/event.dart @@ -365,10 +365,21 @@ class _EventFightList extends HookConsumerWidget { const SizedBox(height: 8), for (final fight in fights.value) ListTile( - title: Text("${fight.blueTeam.name} vs ${fight.redTeam.name}"), - subtitle: fight.score != 0 - ? Text("Winner: ${fight.winner.name}") - : Text(fight.start.toString()), + title: Text( + "${fight.blueTeam.name} vs ${fight.redTeam.name}", + style: TextStyle( + color: fight.winner.color.computeLuminance() > 0.5 + ? Colors.black + : Colors.white), + ), + subtitle: Text( + fight.score != 0 + ? fight.start.toString() + : "Winner: ${fight.winner.name}", + style: TextStyle( + color: fight.winner.color.computeLuminance() > 0.5 + ? Colors.black + : Colors.white)), onTap: () { showDialog( context: context, diff --git a/web/index.html b/web/index.html index f03efee..2958c68 100644 --- a/web/index.html +++ b/web/index.html @@ -37,7 +37,7 @@ var serviceWorkerVersion = null; - +