fromMap static method

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

Construct from Map.

Implementation

static UpdateChatMember? 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 actor_user_id = _map['actor_user_id']! as int;
  var date = _map['date']! as int;
  var invite_link = ChatInviteLink.fromMap(_map['invite_link']);
  var via_chat_folder_invite_link =
      _map['via_chat_folder_invite_link']! as bool;
  var old_chat_member = ChatMember.fromMap(_map['old_chat_member'])!;
  var new_chat_member = ChatMember.fromMap(_map['new_chat_member'])!;
  return UpdateChatMember(
    extra: extra,
    clientId: clientId,
    chat_id: chat_id,
    actor_user_id: actor_user_id,
    date: date,
    invite_link: invite_link,
    via_chat_folder_invite_link: via_chat_folder_invite_link,
    old_chat_member: old_chat_member,
    new_chat_member: new_chat_member,
  );
}