decodeSelectionModelConfig<T> static method

SelectionModelConfig<T>? decodeSelectionModelConfig<T>(
  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:

{
  "changedListener": <SelectionModelListener<T>>,
  "type": <SelectionModelType>,
  "updatedListener": <SelectionModelListener<T>>
}

See also

Implementation

static charts.SelectionModelConfig<T>? decodeSelectionModelConfig<T>(
  dynamic map, {
  bool validate = true,
}) {
  charts.SelectionModelConfig<T>? result;

  if (map is charts.SelectionModelConfig<T>) {
    result = map;
  } else if (map != null) {
    assert(SchemaValidator.validate(
      schemaId: '$_baseSchemaUrl/selection_model_config',
      value: map,
      validate: validate,
    ));
    result = charts.SelectionModelConfig<T>(
      changedListener: map['changedListener'],
      type: decodeSelectionModelType(
        map['type'],
        validate: false,
      )!,
      updatedListener: map['updatedListener'],
    );
  }

  return result;
}