From 6a3ca7803c621490634eaa435a24b1a8cfcd0b1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elias=20M=C3=BCller?= Date: Tue, 30 May 2023 18:56:46 +0200 Subject: [PATCH] Fixed tileColor being visible in overflow --- .../more/gradeAverages/gradeAverage.dart | 56 ++++++++++--------- 1 file changed, 29 insertions(+), 27 deletions(-) diff --git a/lib/screen/pages/more/gradeAverages/gradeAverage.dart b/lib/screen/pages/more/gradeAverages/gradeAverage.dart index f5dc469..ad066f1 100644 --- a/lib/screen/pages/more/gradeAverages/gradeAverage.dart +++ b/lib/screen/pages/more/gradeAverages/gradeAverage.dart @@ -108,35 +108,37 @@ class _GradeAverageState extends State { itemBuilder: (context, index) { var grade = gradeSystem ? index + 1 : 14 - index + 1; bool isThis(int e) => e == grade; - return ListTile( - tileColor: grade.isEven ? Colors.transparent : Colors.transparent.withAlpha(50), - title: Center( - child: Row( - children: [ - IconButton( - onPressed: () { - setState(() { - if(!grades.any(isThis)) return; - grades.removeAt(grades.indexWhere(isThis)); - }); - }, - icon: const Icon(Icons.remove), - color: Theme.of(context).colorScheme.onSurface, - ), - Text(getGradeDisplay(grade)), - IconButton( - onPressed: () { - setState(() { - grades.add(grade); - }); - }, - icon: const Icon(Icons.add), - color: Theme.of(context).colorScheme.onSurface, - ), - ], + return Material( + child: ListTile( + tileColor: grade.isEven ? Colors.transparent : Colors.transparent.withAlpha(50), + title: Center( + child: Row( + children: [ + IconButton( + onPressed: () { + setState(() { + if(!grades.any(isThis)) return; + grades.removeAt(grades.indexWhere(isThis)); + }); + }, + icon: const Icon(Icons.remove), + color: Theme.of(context).colorScheme.onSurface, + ), + Text(getGradeDisplay(grade)), + IconButton( + onPressed: () { + setState(() { + grades.add(grade); + }); + }, + icon: const Icon(Icons.add), + color: Theme.of(context).colorScheme.onSurface, + ), + ], + ), ), + trailing: Text("Anzahl: ${grades.where(isThis).length}"), ), - trailing: Text("Anzahl: ${grades.where(isThis).length}"), ); }, itemCount: gradeSystem ? 6 : 15,