fromMap static method

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

Construct from Map.

Implementation

static ForumTopicInfo? 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 message_thread_id = _map['message_thread_id']! as int;
  var name = _map['name']! as String;
  var icon = ForumTopicIcon.fromMap(_map['icon'])!;
  var creation_date = _map['creation_date']! as int;
  var creator_id = MessageSender.fromMap(_map['creator_id'])!;
  var is_general = _map['is_general']! as bool;
  var is_outgoing = _map['is_outgoing']! as bool;
  var is_closed = _map['is_closed']! as bool;
  var is_hidden = _map['is_hidden']! as bool;
  return ForumTopicInfo(
    extra: extra,
    clientId: clientId,
    message_thread_id: message_thread_id,
    name: name,
    icon: icon,
    creation_date: creation_date,
    creator_id: creator_id,
    is_general: is_general,
    is_outgoing: is_outgoing,
    is_closed: is_closed,
    is_hidden: is_hidden,
  );
}