listFromJson static method

List<Role> listFromJson(
  1. List? json
)

Implementation

static List<Role> listFromJson(List<dynamic>? json) {
  if (json == null) {
    return <Role>[];
  }

  return json.fold(<Role>[], (List<Role> previousValue, element) {
    final Role? object = Role.fromJson(element);
    if (object is Role) {
      previousValue.add(object);
    }

    return previousValue;
  });
}