fromMap static method

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

Construct from Map.

Implementation

static Supergroup? 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 id = _map['id']! as int;
  var usernames = Usernames.fromMap(_map['usernames']);
  var date = _map['date']! as int;
  var status = ChatMemberStatus.fromMap(_map['status'])!;
  var member_count = _map['member_count']! as int;
  var has_linked_chat = _map['has_linked_chat']! as bool;
  var has_location = _map['has_location']! as bool;
  var sign_messages = _map['sign_messages']! as bool;
  var join_to_send_messages = _map['join_to_send_messages']! as bool;
  var join_by_request = _map['join_by_request']! as bool;
  var is_slow_mode_enabled = _map['is_slow_mode_enabled']! as bool;
  var is_channel = _map['is_channel']! as bool;
  var is_broadcast_group = _map['is_broadcast_group']! as bool;
  var is_forum = _map['is_forum']! as bool;
  var is_verified = _map['is_verified']! as bool;
  var restriction_reason = _map['restriction_reason']! as String;
  var is_scam = _map['is_scam']! as bool;
  var is_fake = _map['is_fake']! as bool;
  var has_active_stories = _map['has_active_stories']! as bool;
  var has_unread_active_stories = _map['has_unread_active_stories']! as bool;
  return Supergroup(
    extra: extra,
    clientId: clientId,
    id: id,
    usernames: usernames,
    date: date,
    status: status,
    member_count: member_count,
    has_linked_chat: has_linked_chat,
    has_location: has_location,
    sign_messages: sign_messages,
    join_to_send_messages: join_to_send_messages,
    join_by_request: join_by_request,
    is_slow_mode_enabled: is_slow_mode_enabled,
    is_channel: is_channel,
    is_broadcast_group: is_broadcast_group,
    is_forum: is_forum,
    is_verified: is_verified,
    restriction_reason: restriction_reason,
    is_scam: is_scam,
    is_fake: is_fake,
    has_active_stories: has_active_stories,
    has_unread_active_stories: has_unread_active_stories,
  );
}