ChatStatisticsChannel.fromMap constructor

ChatStatisticsChannel.fromMap(
  1. Map<String, dynamic> map
)

Implementation

ChatStatisticsChannel.fromMap(Map<String, dynamic> map) {
  extra = map['@extra'];
  client_id = map['@client_id'];
  if (map['period'] != null) {
    period = TdApiMap.fromMap(map['period']) as DateRange;
  }
  if (map['member_count'] != null) {
    member_count = TdApiMap.fromMap(map['member_count']) as StatisticalValue;
  }
  if (map['mean_view_count'] != null) {
    mean_view_count = TdApiMap.fromMap(map['mean_view_count']) as StatisticalValue;
  }
  if (map['mean_share_count'] != null) {
    mean_share_count = TdApiMap.fromMap(map['mean_share_count']) as StatisticalValue;
  }
  enabled_notifications_percentage = map['enabled_notifications_percentage'];
  if (map['member_count_graph'] != null) {
    member_count_graph = TdApiMap.fromMap(map['member_count_graph']) as StatisticalGraph;
  }
  if (map['join_graph'] != null) {
    join_graph = TdApiMap.fromMap(map['join_graph']) as StatisticalGraph;
  }
  if (map['mute_graph'] != null) {
    mute_graph = TdApiMap.fromMap(map['mute_graph']) as StatisticalGraph;
  }
  if (map['view_count_by_hour_graph'] != null) {
    view_count_by_hour_graph = TdApiMap.fromMap(map['view_count_by_hour_graph']) as StatisticalGraph;
  }
  if (map['view_count_by_source_graph'] != null) {
    view_count_by_source_graph = TdApiMap.fromMap(map['view_count_by_source_graph']) as StatisticalGraph;
  }
  if (map['join_by_source_graph'] != null) {
    join_by_source_graph = TdApiMap.fromMap(map['join_by_source_graph']) as StatisticalGraph;
  }
  if (map['language_graph'] != null) {
    language_graph = TdApiMap.fromMap(map['language_graph']) as StatisticalGraph;
  }
  if (map['message_interaction_graph'] != null) {
    message_interaction_graph = TdApiMap.fromMap(map['message_interaction_graph']) as StatisticalGraph;
  }
  if (map['instant_view_interaction_graph'] != null) {
    instant_view_interaction_graph = TdApiMap.fromMap(map['instant_view_interaction_graph']) as StatisticalGraph;
  }
  if (map['recent_message_interactions'] != null) {
    recent_message_interactions = [];
    for (var someValue in map['recent_message_interactions']) {
      if (someValue != null) {
        recent_message_interactions?.add(TdApiMap.fromMap(someValue) as ChatStatisticsMessageInteractionInfo);
      }
    }
  }
}