fromMap static method

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

Construct from Map.

Implementation

static BasicGroupFullInfo? 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 photo = ChatPhoto.fromMap(_map['photo']);
  var description = _map['description']! as String;
  var creator_user_id = _map['creator_user_id']! as int;
  var members = List<ChatMember>.from(
    (_map["members"] ?? []).map(
      (e) => ChatMember.fromMap(e),
    ),
  );
  var can_hide_members = _map['can_hide_members']! as bool;
  var can_toggle_aggressive_anti_spam =
      _map['can_toggle_aggressive_anti_spam']! as bool;
  var invite_link = ChatInviteLink.fromMap(_map['invite_link']);
  var bot_commands = List<BotCommands>.from(
    (_map["bot_commands"] ?? []).map(
      (e) => BotCommands.fromMap(e),
    ),
  );
  return BasicGroupFullInfo(
    extra: extra,
    clientId: clientId,
    photo: photo,
    description: description,
    creator_user_id: creator_user_id,
    members: members,
    can_hide_members: can_hide_members,
    can_toggle_aggressive_anti_spam: can_toggle_aggressive_anti_spam,
    invite_link: invite_link,
    bot_commands: bot_commands,
  );
}