fieldsFromJson function

List<List<Field>> fieldsFromJson(
  1. List value
)

Implementation

List<List<Field>> fieldsFromJson(List<dynamic> value) {
  final List<List<Field>> fields = [];
  for (final dynamic fieldJsonRow in value) {
    if (fieldJsonRow is List) {
      fields.add(fieldsFromJsonRow(fieldJsonRow));
    } else {
      throw Exception('Incorrect type of fields');
    }
  }
  return fields;
}