StatsBroadcastStats.deserialize constructor

StatsBroadcastStats.deserialize(
  1. BinaryReader reader
)

Deserialize.

Implementation

factory StatsBroadcastStats.deserialize(BinaryReader reader) {
  // Read [StatsBroadcastStats] fields.
  final period = reader.readObject() as StatsDateRangeDaysBase;
  final followers = reader.readObject() as StatsAbsValueAndPrevBase;
  final viewsPerPost = reader.readObject() as StatsAbsValueAndPrevBase;
  final sharesPerPost = reader.readObject() as StatsAbsValueAndPrevBase;
  final reactionsPerPost = reader.readObject() as StatsAbsValueAndPrevBase;
  final viewsPerStory = reader.readObject() as StatsAbsValueAndPrevBase;
  final sharesPerStory = reader.readObject() as StatsAbsValueAndPrevBase;
  final reactionsPerStory = reader.readObject() as StatsAbsValueAndPrevBase;
  final enabledNotifications = reader.readObject() as StatsPercentValueBase;
  final growthGraph = reader.readObject() as StatsGraphBase;
  final followersGraph = reader.readObject() as StatsGraphBase;
  final muteGraph = reader.readObject() as StatsGraphBase;
  final topHoursGraph = reader.readObject() as StatsGraphBase;
  final interactionsGraph = reader.readObject() as StatsGraphBase;
  final ivInteractionsGraph = reader.readObject() as StatsGraphBase;
  final viewsBySourceGraph = reader.readObject() as StatsGraphBase;
  final newFollowersBySourceGraph = reader.readObject() as StatsGraphBase;
  final languagesGraph = reader.readObject() as StatsGraphBase;
  final reactionsByEmotionGraph = reader.readObject() as StatsGraphBase;
  final storyInteractionsGraph = reader.readObject() as StatsGraphBase;
  final storyReactionsByEmotionGraph = reader.readObject() as StatsGraphBase;
  final recentPostsInteractions =
      reader.readVectorObject<PostInteractionCountersBase>();

  // Construct [StatsBroadcastStats] object.
  final returnValue = StatsBroadcastStats(
    period: period,
    followers: followers,
    viewsPerPost: viewsPerPost,
    sharesPerPost: sharesPerPost,
    reactionsPerPost: reactionsPerPost,
    viewsPerStory: viewsPerStory,
    sharesPerStory: sharesPerStory,
    reactionsPerStory: reactionsPerStory,
    enabledNotifications: enabledNotifications,
    growthGraph: growthGraph,
    followersGraph: followersGraph,
    muteGraph: muteGraph,
    topHoursGraph: topHoursGraph,
    interactionsGraph: interactionsGraph,
    ivInteractionsGraph: ivInteractionsGraph,
    viewsBySourceGraph: viewsBySourceGraph,
    newFollowersBySourceGraph: newFollowersBySourceGraph,
    languagesGraph: languagesGraph,
    reactionsByEmotionGraph: reactionsByEmotionGraph,
    storyInteractionsGraph: storyInteractionsGraph,
    storyReactionsByEmotionGraph: storyReactionsByEmotionGraph,
    recentPostsInteractions: recentPostsInteractions,
  );

  // Now return the deserialized [StatsBroadcastStats].
  return returnValue;
}