ListTasksResponse.fromJson constructor

ListTasksResponse.fromJson(
  1. Object? j
)

Implementation

factory ListTasksResponse.fromJson(Object? j) {
  final json = j as Map<String, Object?>;
  return ListTasksResponse(
    tasks: switch (json['tasks']) {
      null => [],
      List<Object?> $1 => [for (final i in $1) Task.fromJson(i)],
      _ => throw const FormatException('"tasks" is not a list'),
    },
    nextPageToken: switch (json['nextPageToken']) {
      null => '',
      Object $1 => decodeString($1),
    },
  );
}