metric property Null safety

void metric=(Function? newMetric)

Set the new metric function. This must be done after JSON deserialization since JSON can't serialize Function.

Implementation

set metric(Function? newMetric) {
  _metric = newMetric;
}