GridRow.fromJson constructor

GridRow.fromJson(
  1. dynamic json,
  2. List<GridField> fields,
  3. dynamic schema
)

Creates a GridRow from json

fields is used to map the correct type of entries

Implementation

factory GridRow.fromJson(
    dynamic json, List<GridField> fields, dynamic schema) {
  final data = json['fields'] as List;
  final entries = List<GridEntry>.generate(
      data.length,
      (i) => GridEntry.fromJson(
          data[i], fields[i], schema['properties']['fields']['items'][i]));
  return GridRow(json['_id'], entries);
}