deserialize<T> method
Deserialize the provided json data
to an object of type t
or T
.
Implementation
@override
T deserialize<T>(
dynamic data, [
Type? t,
]) {
t ??= T;
if (t == _i3.AppleAuthInfo) {
return _i3.AppleAuthInfo.fromJson(data) as T;
}
if (t == _i4.AuthKey) {
return _i4.AuthKey.fromJson(data) as T;
}
if (t == _i5.AuthenticationFailReason) {
return _i5.AuthenticationFailReason.fromJson(data) as T;
}
if (t == _i6.AuthenticationResponse) {
return _i6.AuthenticationResponse.fromJson(data) as T;
}
if (t == _i7.EmailAuth) {
return _i7.EmailAuth.fromJson(data) as T;
}
if (t == _i8.EmailCreateAccountRequest) {
return _i8.EmailCreateAccountRequest.fromJson(data) as T;
}
if (t == _i9.EmailFailedSignIn) {
return _i9.EmailFailedSignIn.fromJson(data) as T;
}
if (t == _i10.EmailPasswordReset) {
return _i10.EmailPasswordReset.fromJson(data) as T;
}
if (t == _i11.EmailReset) {
return _i11.EmailReset.fromJson(data) as T;
}
if (t == _i12.GoogleRefreshToken) {
return _i12.GoogleRefreshToken.fromJson(data) as T;
}
if (t == _i13.UserImage) {
return _i13.UserImage.fromJson(data) as T;
}
if (t == _i14.UserInfo) {
return _i14.UserInfo.fromJson(data) as T;
}
if (t == _i15.UserInfoPublic) {
return _i15.UserInfoPublic.fromJson(data) as T;
}
if (t == _i16.UserSettingsConfig) {
return _i16.UserSettingsConfig.fromJson(data) as T;
}
if (t == _i1.getType<_i3.AppleAuthInfo?>()) {
return (data != null ? _i3.AppleAuthInfo.fromJson(data) : null) as T;
}
if (t == _i1.getType<_i4.AuthKey?>()) {
return (data != null ? _i4.AuthKey.fromJson(data) : null) as T;
}
if (t == _i1.getType<_i5.AuthenticationFailReason?>()) {
return (data != null ? _i5.AuthenticationFailReason.fromJson(data) : null)
as T;
}
if (t == _i1.getType<_i6.AuthenticationResponse?>()) {
return (data != null ? _i6.AuthenticationResponse.fromJson(data) : null)
as T;
}
if (t == _i1.getType<_i7.EmailAuth?>()) {
return (data != null ? _i7.EmailAuth.fromJson(data) : null) as T;
}
if (t == _i1.getType<_i8.EmailCreateAccountRequest?>()) {
return (data != null
? _i8.EmailCreateAccountRequest.fromJson(data)
: null) as T;
}
if (t == _i1.getType<_i9.EmailFailedSignIn?>()) {
return (data != null ? _i9.EmailFailedSignIn.fromJson(data) : null) as T;
}
if (t == _i1.getType<_i10.EmailPasswordReset?>()) {
return (data != null ? _i10.EmailPasswordReset.fromJson(data) : null)
as T;
}
if (t == _i1.getType<_i11.EmailReset?>()) {
return (data != null ? _i11.EmailReset.fromJson(data) : null) as T;
}
if (t == _i1.getType<_i12.GoogleRefreshToken?>()) {
return (data != null ? _i12.GoogleRefreshToken.fromJson(data) : null)
as T;
}
if (t == _i1.getType<_i13.UserImage?>()) {
return (data != null ? _i13.UserImage.fromJson(data) : null) as T;
}
if (t == _i1.getType<_i14.UserInfo?>()) {
return (data != null ? _i14.UserInfo.fromJson(data) : null) as T;
}
if (t == _i1.getType<_i15.UserInfoPublic?>()) {
return (data != null ? _i15.UserInfoPublic.fromJson(data) : null) as T;
}
if (t == _i1.getType<_i16.UserSettingsConfig?>()) {
return (data != null ? _i16.UserSettingsConfig.fromJson(data) : null)
as T;
}
if (t == List<String>) {
return (data as List).map((e) => deserialize<String>(e)).toList()
as dynamic;
}
try {
return _i2.Protocol().deserialize<T>(data, t);
} on _i1.DeserializationTypeNotFoundException catch (_) {}
return super.deserialize<T>(data, t);
}