Skip to content

Commit

Permalink
refactor: fight_screen to fight_display, match_sequence to match_display
Browse files Browse the repository at this point in the history
  • Loading branch information
Gustl22 committed Dec 2, 2023
1 parent 62cebf3 commit 5ab4607
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,21 @@ 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';

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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -83,6 +83,6 @@ class MatchesWidget<T extends DataObject?> extends StatelessWidget {
}

handleSelectedMatchSequence(TeamMatch match, BuildContext context) {
context.go('/${TeamMatchOverview.route}/${match.id}/${MatchSequence.route}');
context.go('/${TeamMatchOverview.route}/${match.id}/${MatchDisplay.route}');
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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 {
Expand Down
8 changes: 4 additions & 4 deletions wrestling_scoreboard_client/lib/ui/router.dart
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -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',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down

0 comments on commit 5ab4607

Please sign in to comment.