fromJson static method

Probe? fromJson(
  1. Map<String, Object?> json
)

Implementation

static Probe? fromJson(Map<String, Object?> json) {
  // `command` as the fallback key: that is where a config pinning an older
  // `flutterware` puts its argv, and a probe that stops being read is a panel
  // that stops knowing anything.
  var run = StackRun.fromJson(json['run'] ?? json['command']);
  if (run == null) return null;
  return ProbeShape.byName(json['shape'] as String?) == ProbeShape.json
      ? Probe.json(run)
      : Probe.exitCode(run);
}