From 5ab4607e5bfa7bd7dfea2482278ec1980cd44ce2 Mon Sep 17 00:00:00 2001 From: Gustl22 Date: Sun, 3 Dec 2023 00:43:35 +0100 Subject: [PATCH] refactor: fight_screen to fight_display, match_sequence to match_display --- .../ui/fight/{fight_screen.dart => fight_display.dart} | 0 .../lib/ui/fight/fight_main_controls.dart | 5 ++--- .../lib/ui/fight/fight_shortcuts.dart | 3 +-- .../ui/match/{match_sequence.dart => match_display.dart} | 8 ++++---- .../lib/ui/overview/shared/matches_widget.dart | 4 ++-- .../lib/ui/overview/team_match_overview.dart | 4 ++-- wrestling_scoreboard_client/lib/ui/router.dart | 8 ++++---- .../lib/util/print/pdf/score_sheet.dart | 2 +- 8 files changed, 16 insertions(+), 18 deletions(-) rename wrestling_scoreboard_client/lib/ui/fight/{fight_screen.dart => fight_display.dart} (100%) rename wrestling_scoreboard_client/lib/ui/match/{match_sequence.dart => match_display.dart} (98%) diff --git a/wrestling_scoreboard_client/lib/ui/fight/fight_screen.dart b/wrestling_scoreboard_client/lib/ui/fight/fight_display.dart similarity index 100% rename from wrestling_scoreboard_client/lib/ui/fight/fight_screen.dart rename to wrestling_scoreboard_client/lib/ui/fight/fight_display.dart diff --git a/wrestling_scoreboard_client/lib/ui/fight/fight_main_controls.dart b/wrestling_scoreboard_client/lib/ui/fight/fight_main_controls.dart index d7d109e8..20e30241 100644 --- a/wrestling_scoreboard_client/lib/ui/fight/fight_main_controls.dart +++ b/wrestling_scoreboard_client/lib/ui/fight/fight_main_controls.dart @@ -3,12 +3,11 @@ import 'package:flutter_gen/gen_l10n/app_localizations.dart'; import 'package:provider/provider.dart'; import 'package:wrestling_scoreboard_client/data/fight_result.dart'; import 'package:wrestling_scoreboard_client/data/fight_role.dart'; +import 'package:wrestling_scoreboard_client/ui/fight/fight_display.dart'; +import 'package:wrestling_scoreboard_client/ui/fight/fight_shortcuts.dart'; import 'package:wrestling_scoreboard_client/util/network/data_provider.dart'; import 'package:wrestling_scoreboard_common/common.dart'; -import 'fight_screen.dart'; -import 'fight_shortcuts.dart'; - class FightMainControls extends StatefulWidget { final Function(FightScreenActionIntent) callback; final FightState fightState; diff --git a/wrestling_scoreboard_client/lib/ui/fight/fight_shortcuts.dart b/wrestling_scoreboard_client/lib/ui/fight/fight_shortcuts.dart index fb73da13..1f2d8136 100644 --- a/wrestling_scoreboard_client/lib/ui/fight/fight_shortcuts.dart +++ b/wrestling_scoreboard_client/lib/ui/fight/fight_shortcuts.dart @@ -3,12 +3,11 @@ import 'dart:async'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:go_router/go_router.dart'; +import 'package:wrestling_scoreboard_client/ui/fight/fight_display.dart'; import 'package:wrestling_scoreboard_client/util/audio/audio.dart'; import 'package:wrestling_scoreboard_client/util/network/data_provider.dart'; import 'package:wrestling_scoreboard_common/common.dart'; -import 'fight_screen.dart'; - enum FightScreenActions { startStop, reset, diff --git a/wrestling_scoreboard_client/lib/ui/match/match_sequence.dart b/wrestling_scoreboard_client/lib/ui/match/match_display.dart similarity index 98% rename from wrestling_scoreboard_client/lib/ui/match/match_sequence.dart rename to wrestling_scoreboard_client/lib/ui/match/match_display.dart index 082e4de9..8eb5dae8 100644 --- a/wrestling_scoreboard_client/lib/ui/match/match_sequence.dart +++ b/wrestling_scoreboard_client/lib/ui/match/match_display.dart @@ -6,7 +6,7 @@ import 'package:wrestling_scoreboard_client/data/fight_role.dart'; import 'package:wrestling_scoreboard_client/data/wrestling_style.dart'; import 'package:wrestling_scoreboard_client/ui/components/consumer.dart'; import 'package:wrestling_scoreboard_client/ui/components/exception.dart'; -import 'package:wrestling_scoreboard_client/ui/fight/fight_screen.dart'; +import 'package:wrestling_scoreboard_client/ui/fight/fight_display.dart'; import 'package:wrestling_scoreboard_client/ui/overview/team_match_overview.dart'; import 'package:wrestling_scoreboard_client/util/units.dart'; import 'package:wrestling_scoreboard_common/common.dart'; @@ -14,13 +14,13 @@ import 'package:wrestling_scoreboard_common/common.dart'; import '../components/fitted_text.dart'; import 'common_elements.dart'; -class MatchSequence extends StatelessWidget { - static const route = 'match_sequence'; +class MatchDisplay extends StatelessWidget { + static const route = 'match_display'; final int id; final TeamMatch? teamMatch; - const MatchSequence({required this.id, this.teamMatch, Key? key}) : super(key: key); + const MatchDisplay({required this.id, this.teamMatch, Key? key}) : super(key: key); @override Widget build(BuildContext context) { diff --git a/wrestling_scoreboard_client/lib/ui/overview/shared/matches_widget.dart b/wrestling_scoreboard_client/lib/ui/overview/shared/matches_widget.dart index 858c020b..dbbe0786 100644 --- a/wrestling_scoreboard_client/lib/ui/overview/shared/matches_widget.dart +++ b/wrestling_scoreboard_client/lib/ui/overview/shared/matches_widget.dart @@ -5,7 +5,7 @@ import 'package:wrestling_scoreboard_client/ui/components/consumer.dart'; import 'package:wrestling_scoreboard_client/ui/components/exception.dart'; import 'package:wrestling_scoreboard_client/ui/components/grouped_list.dart'; import 'package:wrestling_scoreboard_client/ui/edit/team_match_edit.dart'; -import 'package:wrestling_scoreboard_client/ui/match/match_sequence.dart'; +import 'package:wrestling_scoreboard_client/ui/match/match_display.dart'; import 'package:wrestling_scoreboard_client/ui/overview/team_match_overview.dart'; import 'package:wrestling_scoreboard_client/util/date_time.dart'; import 'package:wrestling_scoreboard_common/common.dart'; @@ -83,6 +83,6 @@ class MatchesWidget extends StatelessWidget { } handleSelectedMatchSequence(TeamMatch match, BuildContext context) { - context.go('/${TeamMatchOverview.route}/${match.id}/${MatchSequence.route}'); + context.go('/${TeamMatchOverview.route}/${match.id}/${MatchDisplay.route}'); } } diff --git a/wrestling_scoreboard_client/lib/ui/overview/team_match_overview.dart b/wrestling_scoreboard_client/lib/ui/overview/team_match_overview.dart index ca2ae70d..691e2205 100644 --- a/wrestling_scoreboard_client/lib/ui/overview/team_match_overview.dart +++ b/wrestling_scoreboard_client/lib/ui/overview/team_match_overview.dart @@ -7,7 +7,7 @@ import 'package:wrestling_scoreboard_client/ui/components/grouped_list.dart'; import 'package:wrestling_scoreboard_client/ui/components/info.dart'; import 'package:wrestling_scoreboard_client/ui/edit/lineup_edit.dart'; import 'package:wrestling_scoreboard_client/ui/edit/team_match_edit.dart'; -import 'package:wrestling_scoreboard_client/ui/match/match_sequence.dart'; +import 'package:wrestling_scoreboard_client/ui/match/match_display.dart'; import 'package:wrestling_scoreboard_client/ui/overview/common.dart'; import 'package:wrestling_scoreboard_client/util/date_time.dart'; import 'package:wrestling_scoreboard_client/util/network/data_provider.dart'; @@ -134,7 +134,7 @@ class TeamMatchOverview extends StatelessWidget { } handleSelectedMatchSequence(TeamMatch match, BuildContext context) { - context.go('/${TeamMatchOverview.route}/${match.id}/${MatchSequence.route}'); + context.go('/${TeamMatchOverview.route}/${match.id}/${MatchDisplay.route}'); } handleSelectedLineup(Lineup lineup, League league, TeamMatch match, NavigatorState navigator) async { diff --git a/wrestling_scoreboard_client/lib/ui/router.dart b/wrestling_scoreboard_client/lib/ui/router.dart index dffbb2b4..f4ef44a7 100644 --- a/wrestling_scoreboard_client/lib/ui/router.dart +++ b/wrestling_scoreboard_client/lib/ui/router.dart @@ -1,7 +1,7 @@ import 'package:go_router/go_router.dart'; import 'package:wrestling_scoreboard_client/ui/app_navigation.dart'; -import 'package:wrestling_scoreboard_client/ui/fight/fight_screen.dart'; -import 'package:wrestling_scoreboard_client/ui/match/match_sequence.dart'; +import 'package:wrestling_scoreboard_client/ui/fight/fight_display.dart'; +import 'package:wrestling_scoreboard_client/ui/match/match_display.dart'; import 'package:wrestling_scoreboard_client/ui/overview/club_overview.dart'; import 'package:wrestling_scoreboard_client/ui/overview/league_overview.dart'; import 'package:wrestling_scoreboard_client/ui/overview/membership_overview.dart'; @@ -28,8 +28,8 @@ final router = GoRouter( builder: (context, state) => TeamMatchOverview(id: int.parse(state.pathParameters['match_id']!)), routes: [ GoRoute( - path: MatchSequence.route, - builder: (context, state) => MatchSequence(id: int.parse(state.pathParameters['match_id']!)), + path: MatchDisplay.route, + builder: (context, state) => MatchDisplay(id: int.parse(state.pathParameters['match_id']!)), ), GoRoute( path: '${FightDisplay.route}/:fight_id', diff --git a/wrestling_scoreboard_client/lib/util/print/pdf/score_sheet.dart b/wrestling_scoreboard_client/lib/util/print/pdf/score_sheet.dart index 5d2ad410..0c836188 100644 --- a/wrestling_scoreboard_client/lib/util/print/pdf/score_sheet.dart +++ b/wrestling_scoreboard_client/lib/util/print/pdf/score_sheet.dart @@ -6,7 +6,7 @@ import 'package:flutter_gen/gen_l10n/app_localizations.dart'; import 'package:pdf/pdf.dart'; import 'package:pdf/widgets.dart'; import 'package:printing/printing.dart'; -import 'package:wrestling_scoreboard_client/ui/fight/fight_screen.dart'; +import 'package:wrestling_scoreboard_client/ui/fight/fight_display.dart'; import 'package:wrestling_scoreboard_client/util/date_time.dart'; import 'package:wrestling_scoreboard_common/common.dart';