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;
final dataClassName = getClassNameFromObjectJson(data);
if (dataClassName != null && dataClassName != getClassNameForType(t)) {
try {
return deserializeByClassName({
'className': dataClassName,
'data': data,
});
} on _isc.DeserializationClassNameNotFoundException catch (_) {
// If the className is not recognized (e.g., older client receiving
// data with a new subtype), fall back to deserializing without the
// className, using the expected type T.
}
}
if (t == _iwlenhk6.AuthUser) {
return _iwlenhk6.AuthUser.fromJson(data) as T;
}
if (t == _idjlnenv.AuthUserBlockedException) {
return _idjlnenv.AuthUserBlockedException.fromJson(data) as T;
}
if (t == _ievhec41.AuthUserModel) {
return _ievhec41.AuthUserModel.fromJson(data) as T;
}
if (t == _ihi15zs1.AuthUserNotFoundException) {
return _ihi15zs1.AuthUserNotFoundException.fromJson(data) as T;
}
if (t == _i52qy4mw.AuthStrategy) {
return _i52qy4mw.AuthStrategy.fromJson(data) as T;
}
if (t == _ioaqzt9u.AuthSuccess) {
return _ioaqzt9u.AuthSuccess.fromJson(data) as T;
}
if (t == _iymqi1d6.SignInWhileAuthenticatedException) {
return _iymqi1d6.SignInWhileAuthenticatedException.fromJson(data) as T;
}
if (t == _i8d4wdsw.JwtTokenInfo) {
return _i8d4wdsw.JwtTokenInfo.fromJson(data) as T;
}
if (t == _i35co9vj.RefreshTokenExpiredException) {
return _i35co9vj.RefreshTokenExpiredException.fromJson(data) as T;
}
if (t == _ik27atqz.RefreshTokenInvalidSecretException) {
return _ik27atqz.RefreshTokenInvalidSecretException.fromJson(data) as T;
}
if (t == _i20y3j39.RefreshTokenMalformedException) {
return _i20y3j39.RefreshTokenMalformedException.fromJson(data) as T;
}
if (t == _in48f3pc.RefreshTokenNotFoundException) {
return _in48f3pc.RefreshTokenNotFoundException.fromJson(data) as T;
}
if (t == _i6w0tdii.TokenPair) {
return _i6w0tdii.TokenPair.fromJson(data) as T;
}
if (t == _ichiyqlu.UserProfile) {
return _ichiyqlu.UserProfile.fromJson(data) as T;
}
if (t == _isbbac0p.UserProfileData) {
return _isbbac0p.UserProfileData.fromJson(data) as T;
}
if (t == _iu5nhigv.UserProfileImage) {
return _iu5nhigv.UserProfileImage.fromJson(data) as T;
}
if (t == _iw6ug6lb.UserProfileModel) {
return _iw6ug6lb.UserProfileModel.fromJson(data) as T;
}
if (t == _izgso6n0.ServerSideSessionInfo) {
return _izgso6n0.ServerSideSessionInfo.fromJson(data) as T;
}
if (t == _isc.getType<_iwlenhk6.AuthUser?>()) {
return (data != null ? _iwlenhk6.AuthUser.fromJson(data) : null) as T;
}
if (t == _isc.getType<_idjlnenv.AuthUserBlockedException?>()) {
return (data != null
? _idjlnenv.AuthUserBlockedException.fromJson(data)
: null)
as T;
}
if (t == _isc.getType<_ievhec41.AuthUserModel?>()) {
return (data != null ? _ievhec41.AuthUserModel.fromJson(data) : null)
as T;
}
if (t == _isc.getType<_ihi15zs1.AuthUserNotFoundException?>()) {
return (data != null
? _ihi15zs1.AuthUserNotFoundException.fromJson(data)
: null)
as T;
}
if (t == _isc.getType<_i52qy4mw.AuthStrategy?>()) {
return (data != null ? _i52qy4mw.AuthStrategy.fromJson(data) : null) as T;
}
if (t == _isc.getType<_ioaqzt9u.AuthSuccess?>()) {
return (data != null ? _ioaqzt9u.AuthSuccess.fromJson(data) : null) as T;
}
if (t == _isc.getType<_iymqi1d6.SignInWhileAuthenticatedException?>()) {
return (data != null
? _iymqi1d6.SignInWhileAuthenticatedException.fromJson(data)
: null)
as T;
}
if (t == _isc.getType<_i8d4wdsw.JwtTokenInfo?>()) {
return (data != null ? _i8d4wdsw.JwtTokenInfo.fromJson(data) : null) as T;
}
if (t == _isc.getType<_i35co9vj.RefreshTokenExpiredException?>()) {
return (data != null
? _i35co9vj.RefreshTokenExpiredException.fromJson(data)
: null)
as T;
}
if (t == _isc.getType<_ik27atqz.RefreshTokenInvalidSecretException?>()) {
return (data != null
? _ik27atqz.RefreshTokenInvalidSecretException.fromJson(data)
: null)
as T;
}
if (t == _isc.getType<_i20y3j39.RefreshTokenMalformedException?>()) {
return (data != null
? _i20y3j39.RefreshTokenMalformedException.fromJson(data)
: null)
as T;
}
if (t == _isc.getType<_in48f3pc.RefreshTokenNotFoundException?>()) {
return (data != null
? _in48f3pc.RefreshTokenNotFoundException.fromJson(data)
: null)
as T;
}
if (t == _isc.getType<_i6w0tdii.TokenPair?>()) {
return (data != null ? _i6w0tdii.TokenPair.fromJson(data) : null) as T;
}
if (t == _isc.getType<_ichiyqlu.UserProfile?>()) {
return (data != null ? _ichiyqlu.UserProfile.fromJson(data) : null) as T;
}
if (t == _isc.getType<_isbbac0p.UserProfileData?>()) {
return (data != null ? _isbbac0p.UserProfileData.fromJson(data) : null)
as T;
}
if (t == _isc.getType<_iu5nhigv.UserProfileImage?>()) {
return (data != null ? _iu5nhigv.UserProfileImage.fromJson(data) : null)
as T;
}
if (t == _isc.getType<_iw6ug6lb.UserProfileModel?>()) {
return (data != null ? _iw6ug6lb.UserProfileModel.fromJson(data) : null)
as T;
}
if (t == _isc.getType<_izgso6n0.ServerSideSessionInfo?>()) {
return (data != null
? _izgso6n0.ServerSideSessionInfo.fromJson(data)
: null)
as T;
}
if (t == Set<String>) {
return (data as List).map((e) => deserialize<String>(e)).toSet() as T;
}
return super.deserialize<T>(data, t);
}