fromJson static method

Metric? fromJson(
  1. Map<String, dynamic>? json
)

Returns a new Metric instance and imports its values from json if it's non-null, null if json is null.

Implementation

static Metric? fromJson(Map<String, dynamic>? json) {
  if (json == null) {
    return null;
  }

  return Metric(
    name: json[r'name'],
    duration: Duration.fromJson(json[r'duration']),
  );
}