simplified code across the app and consolidated duplicated helpers
This commit is contained in:
@@ -8,12 +8,13 @@ import '../../../../state/app/modules/timetable/bloc/timetable_bloc.dart';
|
||||
import '../../../../widget/confirm_dialog.dart';
|
||||
import '../../../../widget/demo_restricted.dart';
|
||||
|
||||
Completer<void> showDeleteCustomEventDialog(
|
||||
/// Completes once the event was deleted; never when the dialog is dismissed.
|
||||
Future<void> showDeleteCustomEventDialog(
|
||||
BuildContext context,
|
||||
CustomTimetableEvent event,
|
||||
) {
|
||||
final completer = Completer<void>();
|
||||
if (guardDemoAction(context)) return completer;
|
||||
if (guardDemoAction(context)) return completer.future;
|
||||
final bloc = context.read<TimetableBloc>();
|
||||
ConfirmDialog(
|
||||
title: 'Termin löschen',
|
||||
@@ -25,5 +26,5 @@ Completer<void> showDeleteCustomEventDialog(
|
||||
completer.complete();
|
||||
},
|
||||
).asDialog(context);
|
||||
return completer;
|
||||
return completer.future;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user