Updated LiveEditListTile
All checks were successful
Pull Request Pipeline / test (pull_request) Successful in 46s
Pull Request Pipeline / lint (pull_request) Successful in 48s

This commit is contained in:
2026-05-06 20:18:46 +02:00
parent 4037a961d1
commit 013fd29182
2 changed files with 47 additions and 34 deletions

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,32 +35,35 @@ 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( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
Text( MainMenuButton(
widget.title, onPressed: () => _score > minScore
style: const TextStyle(fontSize: 14, fontWeight: FontWeight.bold), ? {
setState(() {
_score--;
if (widget.onChanged != null) {
widget.onChanged!(_score);
}
}),
}
: null,
icon: Icons.remove_rounded,
), ),
Padding( Expanded(
padding: const EdgeInsets.only(left: 20, right: 20, bottom: 10), child: Column(
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
MainMenuButton( Text(
onPressed: () => _score > minScore widget.title,
? { style: const TextStyle(
setState(() { fontSize: 14,
_score--; fontWeight: FontWeight.bold,
if (widget.onChanged != null) { ),
widget.onChanged!(_score);
}
}),
}
: null,
icon: Icons.remove_rounded,
), ),
SizedBox( SizedBox(
width: 150, width: 150,
@@ -68,28 +71,33 @@ class _LiveEditListTileState extends State<LiveEditListTile> {
_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(
onPressed: () => _score < maxScore
? {
setState(() {
_score++;
if (widget.onChanged != null) {
widget.onChanged!(_score);
}
}),
}
: null,
icon: Icons.add_rounded,
),
], ],
), ),
), ),
MainMenuButton(
onPressed: () => _score < maxScore
? {
setState(() {
_score++;
if (widget.onChanged != null) {
widget.onChanged!(_score);
}
}),
}
: null,
icon: Icons.add_rounded,
),
], ],
), ),
); );