toJson method Null safety

Map<String, dynamic> toJson()

Implementation

core.Map<core.String, core.dynamic> toJson() => {
      if (metrics != null) 'metrics': metrics!,
      if (monitoredResource != null) 'monitoredResource': monitoredResource!,
    };