saveTitle method
void
saveTitle( - dynamic context,
- dynamic ref,
- dynamic task,
- String newName,
)
Implementation
void saveTitle(
BuildContext context,
WidgetRef ref,
Task task,
String newName,
) async {
EasyLoading.show(status: L10n.of(context).updatingTask);
final updater = task.updateBuilder();
updater.title(newName);
try {
await updater.send();
EasyLoading.dismiss();
if (!context.mounted) return;
Navigator.pop(context);
} catch (e, s) {
_log.severe('Failed to change title of task', e, s);
if (!context.mounted) {
EasyLoading.dismiss();
return;
}
EasyLoading.showError(
L10n.of(context).updatingTaskFailed(e),
duration: const Duration(seconds: 3),
);
}
}