decodeDomainHighlighter<D> static method

DomainHighlighter<D>? decodeDomainHighlighter<D>(
  1. dynamic map, {
  2. bool validate = true,
})

Decodes the object from a Map-like dynamic structure. This expects the JSON format to be of the following structure:

{
  "selectionModelType": <SelectionModelType>
}

See also:

Implementation

static charts.DomainHighlighter<D>? decodeDomainHighlighter<D>(
  dynamic map, {
  bool validate = true,
}) {
  charts.DomainHighlighter<D>? result;

  if (map is charts.DomainHighlighter<D>) {
    result = map;
  } else if (map != null) {
    assert(SchemaValidator.validate(
      schemaId: '$_baseSchemaUrl/domain_highlighter',
      value: map,
      validate: validate,
    ));
    result = charts.DomainHighlighter<D>(
      decodeSelectionModelType(map['selectionModelType']) ??
          common.SelectionModelType.info,
    );
  }

  return result;
}