Updated match result view
All checks were successful
Pull Request Pipeline / test (pull_request) Successful in 44s
Pull Request Pipeline / lint (pull_request) Successful in 52s

This commit is contained in:
2026-05-21 18:44:30 +02:00
parent df8e060707
commit a497ae872b

View File

@@ -11,7 +11,7 @@ import 'package:tallee/data/models/player.dart';
import 'package:tallee/data/models/score_entry.dart';
import 'package:tallee/data/models/team.dart';
import 'package:tallee/l10n/generated/app_localizations.dart';
import 'package:tallee/presentation/widgets/buttons/custom_width_button.dart';
import 'package:tallee/presentation/widgets/buttons/animated_dialog_button.dart';
import 'package:tallee/presentation/widgets/buttons/haptic_icon_button.dart';
import 'package:tallee/presentation/widgets/tiles/match_result_view/custom_checkbox_list_tile.dart';
import 'package:tallee/presentation/widgets/tiles/match_result_view/custom_radio_list_tile.dart';
@@ -90,17 +90,20 @@ class _MatchResultViewState extends State<MatchResultView> {
return Scaffold(
backgroundColor: CustomTheme.backgroundColor,
appBar: AppBar(
automaticallyImplyLeading: true,
leading: HapticIconButton(
icon: const Icon(Icons.close),
onPressed: () {
widget.onWinnerChanged?.call();
Navigator.pop(context);
},
icon: isLiveEditMode
? const Icon(Icons.arrow_back_ios)
: const Icon(Icons.close),
onPressed: isLiveEditMode
? () => setState(() {
isLiveEditMode = false;
})
: () => {widget.onWinnerChanged?.call(), Navigator.pop(context)},
),
title: Text(widget.match.name),
),
body: SafeArea(
child: Column(
body: Column(
children: [
Expanded(
child: isLiveEditMode
@@ -137,7 +140,6 @@ class _MatchResultViewState extends State<MatchResultView> {
// Show player selection
if (rulesetSupportsPlayerSelection())
if (ruleset == Ruleset.multipleWinners)
// TODO: Implement view for teams
Expanded(
child: buildMultipleWinnerSelectionWidget(
isTeamMatch,
@@ -160,24 +162,34 @@ class _MatchResultViewState extends State<MatchResultView> {
),
),
if (rulesetSupportsScoreEntry())
if (!isLiveEditMode) ...[
Padding(
padding: const EdgeInsets.fromLTRB(12, 0, 12, 20),
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
if (rulesetSupportsScoreEntry()) ...[
// Button to switch to live edit mode
...[
CustomWidthButton(
text: isLiveEditMode ? loc.exit_view : loc.live_edit_mode,
sizeRelativeToWidth: 0.95,
AnimatedDialogButton(
buttonConstraints: const BoxConstraints(
minWidth: double.infinity,
minHeight: 50,
),
buttonText: loc.live_edit_mode,
buttonType: ButtonType.secondary,
onPressed: () => setState(() {
isLiveEditMode = !isLiveEditMode;
}),
),
const SizedBox(height: 10),
],
// Save Changes Button
CustomWidthButton(
text: loc.save_changes,
sizeRelativeToWidth: 0.95,
AnimatedDialogButton(
buttonConstraints: const BoxConstraints(
minWidth: double.infinity,
minHeight: 50,
),
buttonText: loc.save_changes,
onPressed: canSave
? () async {
final ending = DateTime.now();
@@ -194,6 +206,9 @@ class _MatchResultViewState extends State<MatchResultView> {
],
),
),
],
],
),
);
}