I have created a website in Flutter web and added all meta tags inside index.html for SEO. The title tags get updated using the Flutter Title widget but I want to update description, keywords, og:title, og:description etc HTML tags for SEO when the webpage changes. How can I do this?
to append meta in header try this in main and before runApp
html.MetaElement meta = html.MetaElement();
meta.content = "meta-content";
meta.name = "meta-name";
html.document.head?.append(meta);
and don't forget to add to pubspec.yaml file in dependencies
http: ^0.13.4
and finally inspect your page to see it , it will be found before closing tag of header , also you can append any script or element to head or body tag
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With