updateTaskListTitle function
Future<void>
updateTaskListTitle( - dynamic context,
- dynamic taskList,
- String newName
)
Implementation
Future<void> updateTaskListTitle(
BuildContext context,
TaskList taskList,
String newName,
) async {
EasyLoading.show(status: L10n.of(context).updatingTask);
final updater = taskList.updateBuilder();
updater.name(newName);
try {
await updater.send();
EasyLoading.dismiss();
if (!context.mounted) return;
Navigator.pop(context);
} catch (e, s) {
_log.severe('Failed to rename tasklist', e, s);
if (!context.mounted) {
EasyLoading.dismiss();
return;
}
EasyLoading.showError(
L10n.of(context).updatingTaskFailed(e),
duration: const Duration(seconds: 3),
);
}
}