dart format

This commit is contained in:
2026-05-08 20:12:40 +02:00
parent 9e139b5704
commit 3b8da1d3d6
295 changed files with 6404 additions and 4161 deletions
@@ -19,7 +19,8 @@ class MarianumDatesView extends StatelessWidget {
static List<_MonthGroup> _groupByMonth(List<MarianumDate> events) {
final byMonth = <String, List<MarianumDate>>{};
for (final e in events) {
final key = '${e.start.year.toString().padLeft(4, '0')}-${e.start.month.toString().padLeft(2, '0')}';
final key =
'${e.start.year.toString().padLeft(4, '0')}-${e.start.month.toString().padLeft(2, '0')}';
byMonth.putIfAbsent(key, () => []).add(e);
}
final keys = byMonth.keys.toList()..sort();
@@ -31,7 +32,8 @@ class MarianumDatesView extends StatelessWidget {
}
@override
Widget build(BuildContext context) => BlocModule<MarianumDatesBloc, LoadableState<MarianumDatesState>>(
Widget build(BuildContext context) =>
BlocModule<MarianumDatesBloc, LoadableState<MarianumDatesState>>(
create: (context) => MarianumDatesBloc(),
autoRebuild: true,
child: (context, bloc, state) => Scaffold(
@@ -42,18 +44,26 @@ class MarianumDatesView extends StatelessWidget {
initialValue: bloc.showPastEvents(),
icon: const Icon(Icons.history),
itemBuilder: (context) => [true, false]
.map((e) => PopupMenuItem<bool>(
value: e,
enabled: e != bloc.showPastEvents(),
child: Row(
children: [
Icon(e ? Icons.history_outlined : Icons.history_toggle_off_outlined,
color: Theme.of(context).colorScheme.onSurface),
const SizedBox(width: 15),
Text(e ? 'Alle anzeigen' : 'Nur zukünftige anzeigen'),
],
),
))
.map(
(e) => PopupMenuItem<bool>(
value: e,
enabled: e != bloc.showPastEvents(),
child: Row(
children: [
Icon(
e
? Icons.history_outlined
: Icons.history_toggle_off_outlined,
color: Theme.of(context).colorScheme.onSurface,
),
const SizedBox(width: 15),
Text(
e ? 'Alle anzeigen' : 'Nur zukünftige anzeigen',
),
],
),
),
)
.toList(),
onSelected: (e) => bloc.add(SetPastEventsVisible(e)),
),
@@ -61,7 +71,10 @@ class MarianumDatesView extends StatelessWidget {
icon: const Icon(Icons.search),
onPressed: () {
final events = bloc.getEvents() ?? const <MarianumDate>[];
showSearch(context: context, delegate: SearchMarianumDates(events));
showSearch(
context: context,
delegate: SearchMarianumDates(events),
);
},
),
],
@@ -89,7 +102,8 @@ class MarianumDatesView extends StatelessWidget {
),
SliverList.builder(
itemCount: group.events.length,
itemBuilder: (_, i) => MarianumDateRow(event: group.events[i]),
itemBuilder: (_, i) =>
MarianumDateRow(event: group.events[i]),
),
],
),