decodeArcLabelLeaderLineStyleSpec static method

ArcLabelLeaderLineStyleSpec? decodeArcLabelLeaderLineStyleSpec(
  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:

{
  "color": <Color>,
  "length": <double>,
  "thickness": <double>
}

See also:

Implementation

static common.ArcLabelLeaderLineStyleSpec? decodeArcLabelLeaderLineStyleSpec(
  dynamic map, {
  bool validate = true,
}) {
  common.ArcLabelLeaderLineStyleSpec? result;

  if (map is common.ArcLabelLeaderLineStyleSpec) {
    result = map;
  } else if (map != null) {
    result = common.ArcLabelLeaderLineStyleSpec(
      color: decodeColor(
            map['color'],
            validate: false,
          ) ??
          charts.MaterialPalette.black,
      length: JsonClass.parseDouble(map['length']) ?? 10.0,
      thickness: JsonClass.parseDouble(map['thickness']) ?? 1.0,
    );
  }

  return result;
}