AuthorizationState.fromJson constructor

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

Implementation

factory AuthorizationState.fromJson(Map<String, dynamic> json) {
  switch (json["@type"]) {
    case AuthorizationStateWaitTdlibParameters.CONSTRUCTOR:
      return AuthorizationStateWaitTdlibParameters.fromJson(json);
    case AuthorizationStateWaitPhoneNumber.CONSTRUCTOR:
      return AuthorizationStateWaitPhoneNumber.fromJson(json);
    case AuthorizationStateWaitEmailAddress.CONSTRUCTOR:
      return AuthorizationStateWaitEmailAddress.fromJson(json);
    case AuthorizationStateWaitEmailCode.CONSTRUCTOR:
      return AuthorizationStateWaitEmailCode.fromJson(json);
    case AuthorizationStateWaitCode.CONSTRUCTOR:
      return AuthorizationStateWaitCode.fromJson(json);
    case AuthorizationStateWaitOtherDeviceConfirmation.CONSTRUCTOR:
      return AuthorizationStateWaitOtherDeviceConfirmation.fromJson(json);
    case AuthorizationStateWaitRegistration.CONSTRUCTOR:
      return AuthorizationStateWaitRegistration.fromJson(json);
    case AuthorizationStateWaitPassword.CONSTRUCTOR:
      return AuthorizationStateWaitPassword.fromJson(json);
    case AuthorizationStateReady.CONSTRUCTOR:
      return AuthorizationStateReady.fromJson(json);
    case AuthorizationStateLoggingOut.CONSTRUCTOR:
      return AuthorizationStateLoggingOut.fromJson(json);
    case AuthorizationStateClosing.CONSTRUCTOR:
      return AuthorizationStateClosing.fromJson(json);
    case AuthorizationStateClosed.CONSTRUCTOR:
      return AuthorizationStateClosed.fromJson(json);
    default:
      return const AuthorizationState();
  }
}