Function to deserialize the task result from JSON.
final T Function(Map<String, dynamic> json) fromJson;