toJsonList static method

List<Map<String, dynamic>>? toJsonList(
  1. List<TestImage>? images, [
  2. bool includeImageData = false
])

Converts the given list of JsonClass objects into JSON. If the given list is null` then null will be returned.

Implementation

static List<Map<String, dynamic>>? toJsonList(
  List<TestImage>? images, [
  bool includeImageData = false,
]) {
  List<Map<String, dynamic>>? result;

  if (images != null) {
    result = <Map<String, dynamic>>[];

    for (var image in images) {
      result.add(image.toJson(includeImageData));
    }
  }

  return result;
}