DisplayMappingObject.fromJson constructor

DisplayMappingObject.fromJson(
  1. dynamic jsonObject
)

Implementation

DisplayMappingObject.fromJson(dynamic jsonObject) {
  var map = credentialToMap(jsonObject);
  if (map.containsKey('path')) {
    List tmp = map['path'];
    path = tmp.map((e) => JsonPath(e)).toList();
  }
  if (map.containsKey('schema')) {
    schema = SchemaObject.fromJson(map['schema']);
  }

  text = map['text'];

  fallback = map['fallback'];

  if (path == null && text == null) {
    throw Exception('Must contain either pth or text');
  }
}