taskOf function

Task taskOf(
  1. Map<String, dynamic> createTaskResult
)

The task a CreateTaskResult announces, in either form: the 2025-11-25 core nests it under task; the 2026-07-28 extension puts its fields on the result itself.

Implementation

Task taskOf(Map<String, dynamic> createTaskResult) {
  final nested = createTaskResult['task'];
  return Task.fromJson(nested is Map
      ? Map<String, Object?>.from(nested)
      : Map<String, Object?>.from(createTaskResult));
}