PageRelatedArticle.deserialize constructor
PageRelatedArticle.deserialize(
- BinaryReader reader
Deserialize.
Implementation
factory PageRelatedArticle.deserialize(BinaryReader reader) {
// Read [PageRelatedArticle] fields.
final flags = reader.readInt32();
final url = reader.readString();
final webpageId = reader.readInt64();
final hasTitleField = (flags & 1) != 0;
final title = hasTitleField ? reader.readString() : null;
final hasDescriptionField = (flags & 2) != 0;
final description = hasDescriptionField ? reader.readString() : null;
final hasPhotoIdField = (flags & 4) != 0;
final photoId = hasPhotoIdField ? reader.readInt64() : null;
final hasAuthorField = (flags & 8) != 0;
final author = hasAuthorField ? reader.readString() : null;
final hasPublishedDateField = (flags & 16) != 0;
final publishedDate = hasPublishedDateField ? reader.readDateTime() : null;
// Construct [PageRelatedArticle] object.
final returnValue = PageRelatedArticle(
url: url,
webpageId: webpageId,
title: title,
description: description,
photoId: photoId,
author: author,
publishedDate: publishedDate,
);
// Now return the deserialized [PageRelatedArticle].
return returnValue;
}