listFromJson static method

List<Attachment>? listFromJson(
  1. List? list
)

Implementation

static List<Attachment>? listFromJson(List<dynamic>? list) {
  if (list == null) {
    return null;
  }
  final attachments = <Attachment>[];
  for (final json in list) {
    final attachment = Attachment.fromJson(json, null);
    if (attachment != null) {
      attachments.add(attachment);
    }
  }
  return attachments;
}