This function has a returm type but doesn't ends with return statement
Я получаю предупреждение "This function has a return type of 'FutureOr<List>', but doesn't end with a return statement"
Мой код
_readTaskList().then((dynamic value) {
if (value != null) {
final List<Task> tasks = <Task>[];
final List<Task> _tasks = value as List<Task>;
tasks.forEach((dynamic element) {
_tasks.add(_convertFromJsonToTask(element as Map<String, dynamic>));
});
return tasks;
} else {
return null;
}
});
}