fromMap static method

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

Construct from Map.

Implementation

static ChatAdministratorRights? 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 can_manage_chat = _map['can_manage_chat']! as bool;
  var can_change_info = _map['can_change_info']! as bool;
  var can_post_messages = _map['can_post_messages']! as bool;
  var can_edit_messages = _map['can_edit_messages']! as bool;
  var can_delete_messages = _map['can_delete_messages']! as bool;
  var can_invite_users = _map['can_invite_users']! as bool;
  var can_restrict_members = _map['can_restrict_members']! as bool;
  var can_pin_messages = _map['can_pin_messages']! as bool;
  var can_manage_topics = _map['can_manage_topics']! as bool;
  var can_promote_members = _map['can_promote_members']! as bool;
  var can_manage_video_chats = _map['can_manage_video_chats']! as bool;
  var can_post_stories = _map['can_post_stories']! as bool;
  var can_edit_stories = _map['can_edit_stories']! as bool;
  var can_delete_stories = _map['can_delete_stories']! as bool;
  var is_anonymous = _map['is_anonymous']! as bool;
  return ChatAdministratorRights(
    extra: extra,
    clientId: clientId,
    can_manage_chat: can_manage_chat,
    can_change_info: can_change_info,
    can_post_messages: can_post_messages,
    can_edit_messages: can_edit_messages,
    can_delete_messages: can_delete_messages,
    can_invite_users: can_invite_users,
    can_restrict_members: can_restrict_members,
    can_pin_messages: can_pin_messages,
    can_manage_topics: can_manage_topics,
    can_promote_members: can_promote_members,
    can_manage_video_chats: can_manage_video_chats,
    can_post_stories: can_post_stories,
    can_edit_stories: can_edit_stories,
    can_delete_stories: can_delete_stories,
    is_anonymous: is_anonymous,
  );
}