$apply method
Implementation
void $apply(MetaSEO seo) {
if (!kIsWeb) {
return;
}
if (title != null) {
seo.ogTitle(ogTitle: title!);
// html.document.title = title!; TODO NEED JS INTEROP FOR WASM
seo.twitterTitle(twitterTitle: title!);
}
if (description != null) {
seo.description(description: description!);
seo.ogDescription(ogDescription: description!);
seo.twitterDescription(twitterDescription: description!);
}
if (keywords != null) {
seo.keywords(keywords: keywords!.join(", "));
}
if (author != null) {
seo.author(author: author!);
}
if (charset != null) {
seo.charset(charset: charset!);
}
if (image != null) {
seo.ogImage(ogImage: image!);
seo.twitterImage(twitterImage: image!);
}
if (robotsName != null && robotsContent != null) {
seo.robots(robotsName: robotsName!, content: robotsContent!);
}
if (twitterCard != null) {
seo.twitterCard(twitterCard: twitterCard!);
}
if (facebookAppID != null) {
seo.facebookAppID(facebookAppID: facebookAppID!);
}
if (url != null) {
seo.propertyContent(property: "og:url", content: url!);
}
if (type != null) {
seo.propertyContent(property: "og:type", content: type!);
}
if (themeColor != null) {
seo.nameContent(
name: "theme-color",
content:
"#${(themeColor!.value & 0xFFFFFF).toRadixString(16).padLeft(6, '0')}");
}
}