dart format
This commit is contained in:
@@ -17,7 +17,10 @@ class CustomEventSheet {
|
||||
context,
|
||||
header: ListTile(
|
||||
leading: const Icon(Icons.event_outlined, size: 32),
|
||||
title: Text(event.title, style: const TextStyle(fontWeight: FontWeight.bold)),
|
||||
title: Text(
|
||||
event.title,
|
||||
style: const TextStyle(fontWeight: FontWeight.bold),
|
||||
),
|
||||
subtitle: Text(timeRange),
|
||||
),
|
||||
children: (sheetCtx) => [
|
||||
@@ -31,7 +34,8 @@ class CustomEventSheet {
|
||||
Navigator.of(sheetCtx).pop();
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (_) => CustomEventEditDialog(existingEvent: event),
|
||||
builder: (_) =>
|
||||
CustomEventEditDialog(existingEvent: event),
|
||||
);
|
||||
},
|
||||
label: const Text('Bearbeiten'),
|
||||
@@ -39,7 +43,9 @@ class CustomEventSheet {
|
||||
),
|
||||
TextButton.icon(
|
||||
onPressed: () {
|
||||
showDeleteCustomEventDialog(context, event).future.then((_) {
|
||||
showDeleteCustomEventDialog(context, event).future.then((
|
||||
_,
|
||||
) {
|
||||
if (!sheetCtx.mounted) return;
|
||||
Navigator.of(sheetCtx).pop();
|
||||
});
|
||||
@@ -54,18 +60,28 @@ class CustomEventSheet {
|
||||
const Divider(height: 1),
|
||||
ListTile(
|
||||
leading: const Icon(Icons.info_outline),
|
||||
title: Text(event.description.isEmpty ? 'Keine Beschreibung' : event.description),
|
||||
title: Text(
|
||||
event.description.isEmpty
|
||||
? 'Keine Beschreibung'
|
||||
: event.description,
|
||||
),
|
||||
),
|
||||
ListTile(
|
||||
leading: const CenteredLeading(Icon(Icons.repeat_outlined)),
|
||||
title: Text('Serie: ${event.rrule.isNotEmpty ? "Wiederholend" : "Einmalig"}'),
|
||||
title: Text(
|
||||
'Serie: ${event.rrule.isNotEmpty ? "Wiederholend" : "Einmalig"}',
|
||||
),
|
||||
subtitle: FutureBuilder(
|
||||
future: RruleL10nEn.create(),
|
||||
builder: (_, snapshot) {
|
||||
if (event.rrule.isEmpty) return const Text('Keine weiteren Vorkommnisse');
|
||||
if (event.rrule.isEmpty) {
|
||||
return const Text('Keine weiteren Vorkommnisse');
|
||||
}
|
||||
if (snapshot.data == null) return const Text('...');
|
||||
final rrule = RecurrenceRule.fromString(event.rrule);
|
||||
if (!rrule.canFullyConvertToText) return const Text('Keine genauere Angabe möglich.');
|
||||
if (!rrule.canFullyConvertToText) {
|
||||
return const Text('Keine genauere Angabe möglich.');
|
||||
}
|
||||
return Text(rrule.toText(l10n: snapshot.data!));
|
||||
},
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user