FAVICON constant
String
const FAVICON
A base64-encoded SVG
favicon string that renders an emoji icon directly in HTML.
This is especially useful for lightweight server-rendered apps or development environments where no external favicon file is hosted.
The icon defaults to the leaf emoji 🍃, but you can replace ${ICON}
with any valid character or emoji.
Example:
final faviconMarkup = HtmlConstant.FAVICON.replaceAll('${HtmlConstant.ICON}', '🔥');
The viewBox
ensures proper scaling, and the font-size
controls how large the emoji renders.
Implementation
static const String FAVICON = "data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 100 100%22><text y=%22.9em%22 font-size=%2290%22>$ICON</text></svg>";