process method
Implementation
@override
Widget process(SeoTag tag, Widget child) {
if (tag is TextTag) {
return Semantics(
label: tag.text,
excludeSemantics: true,
container: true,
child: child,
);
} else if (tag is ImageTag) {
return Semantics(
label: tag.alt,
value: tag.src,
image: true,
excludeSemantics: true,
container: true,
child: child,
);
} else if (tag is LinkTag) {
return Semantics(
label: tag.anchor,
value: tag.href,
link: true,
container: true,
child: child,
);
} else if (tag is HeadTags) {
// Semantics doesn't support a way to pass head tag info to SemanticsNode
return child;
}
throw UnimplementedError('unsupported tag: $tag');
}