fromMap static method

ForumTopics? fromMap(
  1. Map<String, dynamic>? _map
)
override

Construct from Map.

Implementation

static ForumTopics? fromMap(Map<String, dynamic>? _map) {
  if (_map == null) return null;
  var _ = _map["@type"];
  if (_ != CONSTRUCTOR) return null;
  var extra = _map['@extra'];
  var clientId = _map['@clientId'];
  var total_count = _map['total_count']! as int;
  var topics = List<ForumTopic>.from(
    (_map["topics"] ?? []).map(
      (e) => ForumTopic.fromMap(e),
    ),
  );
  var next_offset_date = _map['next_offset_date']! as int;
  var next_offset_message_id = _map['next_offset_message_id']! as int;
  var next_offset_message_thread_id =
      _map['next_offset_message_thread_id']! as int;
  return ForumTopics(
    extra: extra,
    clientId: clientId,
    total_count: total_count,
    topics: topics,
    next_offset_date: next_offset_date,
    next_offset_message_id: next_offset_message_id,
    next_offset_message_thread_id: next_offset_message_thread_id,
  );
}