AltchaChallenge.fromJson constructor

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

Implementation

factory AltchaChallenge.fromJson(Map<String, dynamic> json) {
  return AltchaChallenge(
    algorithm: json['algorithm'] as String,
    codeChallenge: json['codeChallenge'] != null
        ? AltchaCodeChallenge.fromJson(json['codeChallenge'])
        : null,
    challenge: json['challenge'] as String,
    salt: json['salt'] as String,
    signature: json['signature'] as String,
    maxNumber: json['maxNumber'] is int
        ? json['maxNumber']
        : int.tryParse(json['maxNumber'].toString()),
  );
}