BenchmarkScore.parse constructor

BenchmarkScore.parse(
  1. Map<String, Object?> json
)

Deserializes a JSON object to create a BenchmarkScore object.

Implementation

factory BenchmarkScore.parse(Map<String, Object?> json) {
  final String metric = json[metricKey]! as String;
  final double value = (json[valueKey]! as num).toDouble();
  final num? delta = json[deltaKey] as num?;
  return BenchmarkScore(metric: metric, value: value, delta: delta);
}