AuthorizationState.fromJson constructor
a AuthorizationState return type can be :
- AuthorizationStateWaitTdlibParameters
- AuthorizationStateWaitPhoneNumber
- AuthorizationStateWaitEmailAddress
- AuthorizationStateWaitEmailCode
- AuthorizationStateWaitCode
- AuthorizationStateWaitOtherDeviceConfirmation
- AuthorizationStateWaitRegistration
- AuthorizationStateWaitPassword
- AuthorizationStateReady
- AuthorizationStateLoggingOut
- AuthorizationStateClosing
- AuthorizationStateClosed
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();
}
}