toJsonList static method

List toJsonList(
  1. List<JsonClass> list
)

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

Implementation

static List<dynamic> toJsonList(List<JsonClass> list) {
  final result = maybeToJsonList(list);

  if (result == null) {
    throw Exception(
      'Non-nullable toJsonList was called but null was encountered',
    );
  }

  return result;
}