fromMap static method

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

Construct from Map.

Implementation

static UserFullInfo? 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 personal_photo = ChatPhoto.fromMap(_map['personal_photo']);
  var photo = ChatPhoto.fromMap(_map['photo']);
  var public_photo = ChatPhoto.fromMap(_map['public_photo']);
  var block_list = BlockList.fromMap(_map['block_list']);
  var can_be_called = _map['can_be_called']! as bool;
  var supports_video_calls = _map['supports_video_calls']! as bool;
  var has_private_calls = _map['has_private_calls']! as bool;
  var has_private_forwards = _map['has_private_forwards']! as bool;
  var has_restricted_voice_and_video_note_messages =
      _map['has_restricted_voice_and_video_note_messages']! as bool;
  var has_pinned_stories = _map['has_pinned_stories']! as bool;
  var need_phone_number_privacy_exception =
      _map['need_phone_number_privacy_exception']! as bool;
  var bio = FormattedText.fromMap(_map['bio']);
  var premium_gift_options = List<PremiumPaymentOption>.from(
    (_map["premium_gift_options"] ?? []).map(
      (e) => PremiumPaymentOption.fromMap(e),
    ),
  );
  var group_in_common_count = _map['group_in_common_count']! as int;
  var bot_info = BotInfo.fromMap(_map['bot_info']);
  return UserFullInfo(
    extra: extra,
    clientId: clientId,
    personal_photo: personal_photo,
    photo: photo,
    public_photo: public_photo,
    block_list: block_list,
    can_be_called: can_be_called,
    supports_video_calls: supports_video_calls,
    has_private_calls: has_private_calls,
    has_private_forwards: has_private_forwards,
    has_restricted_voice_and_video_note_messages:
        has_restricted_voice_and_video_note_messages,
    has_pinned_stories: has_pinned_stories,
    need_phone_number_privacy_exception: need_phone_number_privacy_exception,
    bio: bio,
    premium_gift_options: premium_gift_options,
    group_in_common_count: group_in_common_count,
    bot_info: bot_info,
  );
}