IdentifyResult.fromJson constructor

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

Implementation

factory IdentifyResult.fromJson(Map<String, dynamic> json) => IdentifyResult(
      requestId: _string(json['requestId']) ?? '',
      visitorId: _string(json['visitorId']) ?? '',
      // These and the score are read without a fallback, unlike the strings.
      // A native bridge sends null or nothing when the server did not say,
      // and `?? 0` or `?? false` would turn that into a real answer, which
      // for the score is the one answer that lets somebody through.
      visitorIsNew: _bool(json['visitorIsNew']),
      visitorConfidence: _int(json['visitorConfidence']),
      identifiable: _bool(json['identifiable']),
      duplicate: _bool(json['duplicate']),
      state: _string(json['state']) ?? '',
      reason: _string(json['reason']) ?? '',
      suspectScore: _int(json['suspectScore']),
      suspectLevel: _string(json['suspectLevel']),
      report: SignalReport.fromJson(
        _map(json['report']) ?? const <String, dynamic>{},
      ),
    );