fromMap static method

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

Construct from Map.

Implementation

static AttachmentMenuBot? 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 bot_user_id = _map['bot_user_id']! as int;
  var supports_self_chat = _map['supports_self_chat']! as bool;
  var supports_user_chats = _map['supports_user_chats']! as bool;
  var supports_bot_chats = _map['supports_bot_chats']! as bool;
  var supports_group_chats = _map['supports_group_chats']! as bool;
  var supports_channel_chats = _map['supports_channel_chats']! as bool;
  var supports_settings = _map['supports_settings']! as bool;
  var request_write_access = _map['request_write_access']! as bool;
  var is_added = _map['is_added']! as bool;
  var show_in_attachment_menu = _map['show_in_attachment_menu']! as bool;
  var show_in_side_menu = _map['show_in_side_menu']! as bool;
  var show_disclaimer_in_side_menu =
      _map['show_disclaimer_in_side_menu']! as bool;
  var name = _map['name']! as String;
  var name_color = AttachmentMenuBotColor.fromMap(_map['name_color']);
  var default_icon = File.fromMap(_map['default_icon']);
  var ios_static_icon = File.fromMap(_map['ios_static_icon']);
  var ios_animated_icon = File.fromMap(_map['ios_animated_icon']);
  var ios_side_menu_icon = File.fromMap(_map['ios_side_menu_icon']);
  var android_icon = File.fromMap(_map['android_icon']);
  var android_side_menu_icon = File.fromMap(_map['android_side_menu_icon']);
  var macos_icon = File.fromMap(_map['macos_icon']);
  var macos_side_menu_icon = File.fromMap(_map['macos_side_menu_icon']);
  var icon_color = AttachmentMenuBotColor.fromMap(_map['icon_color']);
  var web_app_placeholder = File.fromMap(_map['web_app_placeholder']);
  return AttachmentMenuBot(
    extra: extra,
    clientId: clientId,
    bot_user_id: bot_user_id,
    supports_self_chat: supports_self_chat,
    supports_user_chats: supports_user_chats,
    supports_bot_chats: supports_bot_chats,
    supports_group_chats: supports_group_chats,
    supports_channel_chats: supports_channel_chats,
    supports_settings: supports_settings,
    request_write_access: request_write_access,
    is_added: is_added,
    show_in_attachment_menu: show_in_attachment_menu,
    show_in_side_menu: show_in_side_menu,
    show_disclaimer_in_side_menu: show_disclaimer_in_side_menu,
    name: name,
    name_color: name_color,
    default_icon: default_icon,
    ios_static_icon: ios_static_icon,
    ios_animated_icon: ios_animated_icon,
    ios_side_menu_icon: ios_side_menu_icon,
    android_icon: android_icon,
    android_side_menu_icon: android_side_menu_icon,
    macos_icon: macos_icon,
    macos_side_menu_icon: macos_side_menu_icon,
    icon_color: icon_color,
    web_app_placeholder: web_app_placeholder,
  );
}