tryGet<T extends EvaluationMetric> method

(bool, T?) tryGet<T extends EvaluationMetric>(
  1. String metricName
)

Returns the metric named metricName cast to T, or null if not found.

The first element of the record is true when a match was found.

Implementation

(bool, T?) tryGet<T extends EvaluationMetric>(String metricName) {
  final m = metrics[metricName];
  if (m is T) return (true, m);
  return (false, null);
}