Live-Edit Modus #207

Merged
sneeex merged 20 commits from feature/202-live-edit-modus into development 2026-05-09 17:58:38 +00:00
Showing only changes of commit 90331bfc07 - Show all commits

View File

@@ -50,7 +50,7 @@ class _MatchResultViewState extends State<MatchResultView> {
@override @override
void initState() { void initState() {
db = Provider.of<AppDatabase>(context, listen: false); db = Provider.of<AppDatabase>(context, listen: false);
ruleset = widget.match.game.ruleset; ruleset = Ruleset.highestScore; //widget.match.game.ruleset;
canSave = !rulesetSupportsScoreEntry(); canSave = !rulesetSupportsScoreEntry();
allPlayers = widget.match.players; allPlayers = widget.match.players;
@@ -93,16 +93,13 @@ class _MatchResultViewState extends State<MatchResultView> {
return Scaffold( return Scaffold(
backgroundColor: CustomTheme.backgroundColor, backgroundColor: CustomTheme.backgroundColor,
appBar: AppBar( appBar: AppBar(
automaticallyImplyLeading: !isLiveEditMode, leading: IconButton(
leading: !isLiveEditMode
? IconButton(
icon: const Icon(Icons.close), icon: const Icon(Icons.close),
onPressed: () { onPressed: () {
widget.onWinnerChanged?.call(); widget.onWinnerChanged?.call();
Navigator.of(context).pop(_selectedPlayer); Navigator.of(context).pop(_selectedPlayer);
}, },
) ),
: null,
title: Text(widget.match.name), title: Text(widget.match.name),
), ),
body: SafeArea( body: SafeArea(
@@ -212,16 +209,16 @@ class _MatchResultViewState extends State<MatchResultView> {
), ),
), ),
), ),
if (!isLiveEditMode) ...[
if (rulesetSupportsScoreEntry()) if (rulesetSupportsScoreEntry())
// Button to switch to live edit mode // Button to switch to live edit mode
...[ ...[
CustomWidthButton( CustomWidthButton(
text: loc.live_edit_mode, text: isLiveEditMode ? loc.exit_view : loc.live_edit_mode,
sizeRelativeToWidth: 0.95, sizeRelativeToWidth: 0.95,
buttonType: ButtonType.secondary, buttonType: ButtonType.secondary,
onPressed: () => setState(() { onPressed: () => setState(() {
isLiveEditMode = true; isLiveEditMode = !isLiveEditMode;
}), }),
), ),
const SizedBox(height: 10), const SizedBox(height: 10),
@@ -244,15 +241,6 @@ class _MatchResultViewState extends State<MatchResultView> {
} }
: null, : null,
), ),
] else ...[
CustomWidthButton(
text: loc.exit_view,
sizeRelativeToWidth: 0.95,
onPressed: () => setState(() {
isLiveEditMode = false;
}),
),
],
], ],
), ),
), ),