UserArray.fromJson constructor

UserArray.fromJson(
  1. Map<String, Object?> json
)

Implementation

factory UserArray.fromJson(Map<String, Object?> json) {
  return UserArray(
    results: (json[r'results'] as List<Object?>?)
            ?.map(
                (i) => User.fromJson(i as Map<String, Object?>? ?? const {}))
            .toList() ??
        [],
    start: (json[r'start'] as num?)?.toInt(),
    limit: (json[r'limit'] as num?)?.toInt(),
    size: (json[r'size'] as num?)?.toInt(),
    totalSize: (json[r'totalSize'] as num?)?.toInt(),
    links: json[r'_links'] != null
        ? GenericLinks.fromJson(json[r'_links']! as Map<String, Object?>)
        : null,
  );
}