listFromJson static method

List<ContentDto>? listFromJson(
  1. dynamic json, {
  2. bool growable = false,
})

Implementation

static List<ContentDto>? listFromJson(
  dynamic json, {
  bool growable = false,
}) {
  final result = <ContentDto>[];
  if (json is List && json.isNotEmpty) {
    for (final row in json) {
      final value = ContentDto.fromJson(row);
      if (value != null) {
        result.add(value);
      }
    }
  }
  return result.toList(growable: growable);
}