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
2 changed files with 47 additions and 34 deletions
Showing only changes of commit 013fd29182 - Show all commits

View File

@@ -110,6 +110,7 @@ class _MatchResultViewState extends State<MatchResultView> {
children: [ children: [
Expanded( Expanded(
child: isLiveEditMode && rulesetSupportsScoreEntry() child: isLiveEditMode && rulesetSupportsScoreEntry()
// Live Edit Mode
? ListView.builder( ? ListView.builder(
itemCount: allPlayers.length, itemCount: allPlayers.length,
itemBuilder: (context, index) { itemBuilder: (context, index) {
@@ -124,6 +125,7 @@ class _MatchResultViewState extends State<MatchResultView> {
); );
}, },
) )
// Normal Mode
: Container( : Container(
margin: const EdgeInsets.symmetric( margin: const EdgeInsets.symmetric(
horizontal: 12, horizontal: 12,
@@ -150,6 +152,8 @@ class _MatchResultViewState extends State<MatchResultView> {
), ),
), ),
const SizedBox(height: 10), const SizedBox(height: 10),
// Show player selection
if (rulesetSupportsWinnerSelection()) if (rulesetSupportsWinnerSelection())
Expanded( Expanded(
child: RadioGroup<Player>( child: RadioGroup<Player>(
@@ -182,6 +186,7 @@ class _MatchResultViewState extends State<MatchResultView> {
), ),
), ),
), ),
// Show score entry
if (rulesetSupportsScoreEntry()) if (rulesetSupportsScoreEntry())
Expanded( Expanded(
child: ListView.separated( child: ListView.separated(

View File

@@ -35,19 +35,12 @@ class _LiveEditListTileState extends State<LiveEditListTile> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Container( return Container(
padding: const EdgeInsets.symmetric(vertical: 10), padding: const EdgeInsets.symmetric(vertical: 12, horizontal: 20),
margin: const EdgeInsets.symmetric(vertical: 12, horizontal: 8), margin: const EdgeInsets.symmetric(vertical: 12, horizontal: 8),
decoration: CustomTheme.standardBoxDecoration, decoration: CustomTheme.standardBoxDecoration,
child: Column(
children: [
Text(
widget.title,
style: const TextStyle(fontSize: 14, fontWeight: FontWeight.bold),
),
Padding(
padding: const EdgeInsets.only(left: 20, right: 20, bottom: 10),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
MainMenuButton( MainMenuButton(
onPressed: () => _score > minScore onPressed: () => _score > minScore
@@ -62,18 +55,36 @@ class _LiveEditListTileState extends State<LiveEditListTile> {
: null, : null,
icon: Icons.remove_rounded, icon: Icons.remove_rounded,
), ),
Expanded(
child: Column(
children: [
Text(
widget.title,
style: const TextStyle(
fontSize: 14,
fontWeight: FontWeight.bold,
),
),
SizedBox( SizedBox(
width: 150, width: 150,
child: NumericText( child: NumericText(
_score.toString(), _score.toString(),
maxLines: 1, maxLines: 1,
textAlign: TextAlign.center, textAlign: TextAlign.center,
textWidthBasis: TextWidthBasis.longestLine,
textHeightBehavior: const TextHeightBehavior(
applyHeightToFirstAscent: false,
applyHeightToLastDescent: false,
),
style: const TextStyle( style: const TextStyle(
fontSize: 48, fontSize: 48,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
), ),
), ),
), ),
],
),
),
MainMenuButton( MainMenuButton(
onPressed: () => _score < maxScore onPressed: () => _score < maxScore
? { ? {
@@ -89,9 +100,6 @@ class _LiveEditListTileState extends State<LiveEditListTile> {
), ),
], ],
), ),
),
],
),
); );
} }
} }