AiutaAuth.fromJson constructor

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

Implementation

factory AiutaAuth.fromJson(Map<String, dynamic> json) {
  switch (json['mode'] as String) {
    case 'apiKey':
      return AiutaApiKeyAuth.fromJson(json);
    case 'jwt':
      return AiutaJwtAuth.fromJson(json);
    default:
      throw Exception('Unknown authentication type');
  }
}