SView.fromJson constructor

SView.fromJson(
  1. dynamic json
)

Creates a SView from value json

Implementation

factory SView.fromJson(
  dynamic json,
) {
  final type =
      SViewType.values.firstWhere((type) => type.backendName == json['type']);
  final fields = (json['fields'] as List?)
      ?.map((json) => GridField.fromJson(json))
      .toList();
  final fieldProperties =
      (json['fieldProperties'] as Map?)?.cast<String, dynamic>();

  return SView(
    name: json['name'],
    id: json['id'],
    type: type,
    links: linkMapFromJson(
      json['_links'],
    ),
    fields: fields,
    fieldProperties: fieldProperties,
    properties: json['properties'],
  );
}