listFromJson static method

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

Implementation

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

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

    return previousValue;
  });
}