fromJson static method
Implementation
static AttachmentMenuBot? fromJson(Map<String, dynamic>? json) {
if (json == null) {
return null;
}
return AttachmentMenuBot(
botUserId: (json['bot_user_id'] as int?) ?? 0,
supportsSelfChat: (json['supports_self_chat'] as bool?) ?? false,
supportsUserChats: (json['supports_user_chats'] as bool?) ?? false,
supportsBotChats: (json['supports_bot_chats'] as bool?) ?? false,
supportsGroupChats: (json['supports_group_chats'] as bool?) ?? false,
supportsChannelChats: (json['supports_channel_chats'] as bool?) ?? false,
requestWriteAccess: (json['request_write_access'] as bool?) ?? false,
isAdded: (json['is_added'] as bool?) ?? false,
showInAttachmentMenu: (json['show_in_attachment_menu'] as bool?) ?? false,
showInSideMenu: (json['show_in_side_menu'] as bool?) ?? false,
showDisclaimerInSideMenu:
(json['show_disclaimer_in_side_menu'] as bool?) ?? false,
name: (json['name'] as String?) ?? '',
nameColor: AttachmentMenuBotColor.fromJson(
tdMapFromJson(json['name_color']),
),
defaultIcon: File.fromJson(tdMapFromJson(json['default_icon'])),
iosStaticIcon: File.fromJson(tdMapFromJson(json['ios_static_icon'])),
iosAnimatedIcon: File.fromJson(tdMapFromJson(json['ios_animated_icon'])),
iosSideMenuIcon: File.fromJson(tdMapFromJson(json['ios_side_menu_icon'])),
androidIcon: File.fromJson(tdMapFromJson(json['android_icon'])),
androidSideMenuIcon: File.fromJson(
tdMapFromJson(json['android_side_menu_icon']),
),
macosIcon: File.fromJson(tdMapFromJson(json['macos_icon'])),
macosSideMenuIcon: File.fromJson(
tdMapFromJson(json['macos_side_menu_icon']),
),
iconColor: AttachmentMenuBotColor.fromJson(
tdMapFromJson(json['icon_color']),
),
webAppPlaceholder: File.fromJson(
tdMapFromJson(json['web_app_placeholder']),
),
);
}