simplified code across the app and consolidated duplicated helpers

This commit is contained in:
2026-09-27 17:29:54 +02:00
parent 3e856d0b1c
commit ee1240f71a
155 changed files with 1772 additions and 2546 deletions
@@ -15,14 +15,14 @@ class GradeAveragesView extends StatelessWidget {
create: (context) => GradeAveragesBloc(),
child: BlocBuilder<GradeAveragesBloc, GradeAveragesState>(
builder: (context, state) {
var bloc = context.watch<GradeAveragesBloc>();
final bloc = context.read<GradeAveragesBloc>();
return Scaffold(
appBar: AppBar(
title: const Text('Notendurchschnittsrechner'),
actions: [
Visibility(
visible: bloc.state.grades.isNotEmpty,
visible: state.grades.isNotEmpty,
child: IconButton(
tooltip: 'Alle zurücksetzen',
onPressed: () => ConfirmDialog(
@@ -59,7 +59,7 @@ class GradeAveragesView extends StatelessWidget {
)
.toList(),
onSelected: (isMiddleSchool) {
if (bloc.state.grades.isNotEmpty) {
if (state.grades.isNotEmpty) {
ConfirmDialog(
title: 'Notensystem wechseln',
content: