DiscordCdnHelper class

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

getApplicationAchievementIcon({required String applicationId, required String achievementId, required String achievementIconHash, DiscordImageFormat format = DiscordImageFormat.png, int size = 128}) String?
Tries to create the right URL slug for an application's achievement icon, given its application_id, achievement_id and icon hash, in a given format (defaults to PNG), with a given size (defaults to 128).
getApplicationAsset({required String applicationId, required String applicationAssetHash, DiscordImageFormat format = DiscordImageFormat.png, int size = 128}) String?
Tries to create the right URL slug for an application asset, given its application_id and asset hash, in a given format (defaults to PNG), with a given size (defaults to 128).
getApplicationCover({required String applicationId, required String applicationCoverHash, DiscordImageFormat format = DiscordImageFormat.png, int size = 128}) String?
Tries to create the right URL slug for an application cover, given its application_id and cover image hash, in a given format (defaults to PNG), with a given size (defaults to 128).
getApplicationIcon({required String applicationId, required String applicationIconHash, DiscordImageFormat format = DiscordImageFormat.png, int size = 128}) String?
Tries to create the right URL slug for an application icon, given its application_id and icon hash, in a given format (defaults to PNG), with a given size (defaults to 128).
getCustomEmoji({required String emojiId, DiscordImageFormat format = DiscordImageFormat.png, int size = 128}) String?
Tries to create the right URL slug for an emoji, given its emoji_id, in a given format (defaults to PNG), with a given size (defaults to 128).
getDefaultUserAvatar(String discriminator) String?
Tries to create the right URL slug for the default user avatar of a user, given it's discriminator.
getGuildBanner({required String guildId, required String guildBannerHash, DiscordImageFormat format = DiscordImageFormat.png, int size = 128}) String?
Tries to create the right URL slug for a guild banner, given its guild_id and banner hash, in a given format (defaults to PNG), with a given size (defaults to 128).
getGuildDiscoverySplash({required String guildId, required String guildDiscoverySplashHash, DiscordImageFormat format = DiscordImageFormat.png, int size = 128}) String?
Tries to create the right URL slug for a guild discovery splash, given its guild_id and discovery splash hash, in a given format (defaults to PNG), with a given size (defaults to 128).
getGuildIcon({required String guildId, required String guildIconHash, DiscordImageFormat format = DiscordImageFormat.png, int size = 128}) String?
Tries to create the right URL slug for a guild icon, given its guild_id and icon hash, in a given format (defaults to PNG), with a given size (defaults to 128).
getGuildMemberAvatar({required String guildId, required String userId, required String memberAvatarHash, DiscordImageFormat format = DiscordImageFormat.png, int size = 128}) String?
Tries to create the right URL slug for a guild member avatar, given its guild_id, user_id and member avatar hash, in a given format (defaults to PNG), with a given size (defaults to 128).
getGuildScheduledEventCover({required String scheduledEventId, required String scheduledEventCoverHash, DiscordImageFormat format = DiscordImageFormat.png, int size = 128}) String?
Tries to create the right URL slug for a guild scheduled event cover, given its scheduled_event_id and schedule event cover image hash, in a given format (defaults to PNG), with a given size (defaults to 128).
getGuildSplash({required String guildId, required String guildSplashHash, DiscordImageFormat format = DiscordImageFormat.png, int size = 128}) String?
Tries to create the right URL slug for a guild splash, given its guild_id and splash hash, in a given format (defaults to PNG), with a given size (defaults to 128).
getRoleIcon({required String roleId, required String roleIconHash, DiscordImageFormat format = DiscordImageFormat.png, int size = 128}) String?
Tries to create the right URL slug for a role icon, given its role_id and role icon hash, in a given format (defaults to PNG), with a given size (defaults to 128).
getSticker({required String stickerId, DiscordImageFormat format = DiscordImageFormat.png}) String?
Tries to create the right URL slug for a sticker, given its sticker_id, in a given format (defaults to PNG).
getStickerPackBanner({required String stickerPackBannerId, DiscordImageFormat format = DiscordImageFormat.png, int size = 128}) String?
Tries to create the right URL slug for a sticker pack banner, given its asset_id, in a given format (defaults to PNG), with a given size (defaults to 128).
getString(String path) String
Returns the CDN URL for a given path, as a String.
getTeamIcon({required String teamId, required String teamIconHash, DiscordImageFormat format = DiscordImageFormat.png, int size = 128}) String?
Tries to create the right URL slug for a team icon, given its team_id and team icon hash, in a given format (defaults to PNG), with a given size (defaults to 128).
getUrl(String path) Uri
Returns the CDN URL for a given path, as an URI.
getUserAvatar({required String userId, required String userAvatarHash, DiscordImageFormat format = DiscordImageFormat.png, int size = 128}) String?
Tries to create the right URL slug for a user avatar, given its user_id and avatar hash, in a given format (defaults to PNG), with a given size (defaults to 128).
getUserBanner({required String userId, required String userBannerHash, DiscordImageFormat format = DiscordImageFormat.png, int size = 128}) String?
Tries to create the right URL slug for a user banner, given its user_id and banner hash, in a given format (defaults to PNG), with a given size (defaults to 128).
isValidSize(int x) bool
Checks whether or not the int x is a valid size for the Discord CDN query parameter size.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Properties

cndUrl Uri
final
instance DiscordCdnHelper
final

Constants

formatList1 → const List<DiscordImageFormat>
Available formats : PNG, JPEG, WebP, GIF
formatList2 → const List<DiscordImageFormat>
Available formats : PNG, JPEG, WebP
formatList3 → const List<DiscordImageFormat>
Available formats : PNG, Lottie