AuthenticateRequestType.fromJsonString constructor

AuthenticateRequestType.fromJsonString(
  1. String jsonString, {
  2. MediationType mediation = MediationType.Optional,
  3. bool preferImmediatelyAvailableCredentials = true,
})

Constructs a new instance from a JSON string.

Implementation

factory AuthenticateRequestType.fromJsonString(
  String jsonString, {
  MediationType mediation = MediationType.Optional,
  bool preferImmediatelyAvailableCredentials = true,
}) {
  final decoded = jsonDecode(jsonString);
  if (decoded is! Map<String, dynamic>) {
    throw FormatException('Expected JSON object, got ${decoded.runtimeType}');
  }
  return AuthenticateRequestType.fromJson(
    decoded,
    mediation: mediation,
    preferImmediatelyAvailableCredentials:
        preferImmediatelyAvailableCredentials,
  );
}