SecureValue.deserialize constructor
SecureValue.deserialize(
- BinaryReader reader
Deserialize.
Implementation
factory SecureValue.deserialize(BinaryReader reader) {
// Read [SecureValue] fields.
final flags = reader.readInt32();
final type = reader.readObject() as SecureValueTypeBase;
final hasDataField = (flags & 1) != 0;
final data = hasDataField ? reader.readObject() as SecureDataBase : null;
final hasFrontSideField = (flags & 2) != 0;
final frontSide =
hasFrontSideField ? reader.readObject() as SecureFileBase : null;
final hasReverseSideField = (flags & 4) != 0;
final reverseSide =
hasReverseSideField ? reader.readObject() as SecureFileBase : null;
final hasSelfieField = (flags & 8) != 0;
final selfie =
hasSelfieField ? reader.readObject() as SecureFileBase : null;
final hasTranslationField = (flags & 64) != 0;
final translation =
hasTranslationField ? reader.readVectorObject<SecureFileBase>() : null;
final hasFilesField = (flags & 16) != 0;
final files =
hasFilesField ? reader.readVectorObject<SecureFileBase>() : null;
final hasPlainDataField = (flags & 32) != 0;
final plainData =
hasPlainDataField ? reader.readObject() as SecurePlainDataBase : null;
final hash = reader.readBytes();
// Construct [SecureValue] object.
final returnValue = SecureValue(
type: type,
data: data,
frontSide: frontSide,
reverseSide: reverseSide,
selfie: selfie,
translation: translation?.items,
files: files?.items,
plainData: plainData,
hash: hash,
);
// Now return the deserialized [SecureValue].
return returnValue;
}