fromMap static method

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

Construct from Map.

Implementation

static ChatInviteLinkInfo? 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 chat_id = _map['chat_id']! as int;
  var accessible_for = _map['accessible_for']! as int;
  var type = InviteLinkChatType.fromMap(_map['type'])!;
  var title = _map['title']! as String;
  var photo = ChatPhotoInfo.fromMap(_map['photo']);
  var description = _map['description']! as String;
  var member_count = _map['member_count']! as int;
  var member_user_ids = List<int>.from(
    (_map["member_user_ids"] ?? []).map(
      (e) => e as int,
    ),
  );
  var creates_join_request = _map['creates_join_request']! as bool;
  var is_public = _map['is_public']! as bool;
  var is_verified = _map['is_verified']! as bool;
  var is_scam = _map['is_scam']! as bool;
  var is_fake = _map['is_fake']! as bool;
  return ChatInviteLinkInfo(
    extra: extra,
    clientId: clientId,
    chat_id: chat_id,
    accessible_for: accessible_for,
    type: type,
    title: title,
    photo: photo,
    description: description,
    member_count: member_count,
    member_user_ids: member_user_ids,
    creates_join_request: creates_join_request,
    is_public: is_public,
    is_verified: is_verified,
    is_scam: is_scam,
    is_fake: is_fake,
  );
}