Package selection guidance compiled from public package information, community data, and project usage.
The seo package is a Flutter plugin designed to enhance SEO capabilities for web applications by enabling dynamic management of meta tags and body attributes. It allows developers to set titles, descriptions, Open Graph tags, and other SEO-related content directly from Dart code. This ensures search engines can properly index web pages, improving visibility and ranking. The package integrates seamlessly with Flutter's web platform and supports server-side rendering considerations. It is particularly useful for apps that require rich metadata control without manual HTML manipulation.
Use cases
Dynamic meta tag updates
Improved search engine indexing
Social media sharing optimization
Single-page application SEO
Content personalization based on route
Server-side rendering compatibility
Key features
Easy meta tag management
Support for Open Graph and Twitter cards
Dynamic title and description changes
Cross-platform web support
Minimal boilerplate
Integration with Flutter routing
Suitable for
Web-only Flutter apps
SEO-focused web applications
Apps with dynamic content
Developers prioritizing search visibility
Projects requiring social media metadata
Apps using client-side routing
Considerations
Not applicable for mobile platforms (Android/iOS)
Requires careful handling in multi-route scenarios
Limited to web platform functionality
Does not replace full SSR frameworks
Manual configuration needed for advanced SEO
Best used with proper page structure
Original README
Original README snapshot from the linked source repository. Visit the repository for the latest content.
flutter_seo
Flutter package for enabling SEO (meta, body tag) support on Web. The package listens to widget tree changes and converts Seo.text(...), Seo.image(...), Seo.link(...), Seo.head(...) widgets into html document tree. View Demo
Use usePathUrlStrategy() to ensure that Google recognizes each URL as a distinct page. Failure to do so may result in Google perceiving all URLs as the same page. For additional details, refer to this video.
Wrap your app within SeoController which will handle listening to widget tree changes and updating the html document tree. In case your app has authorization and user is logged in you can disable the controller by enabled: false as it's redundant to update the html document tree at that state.
WidgetTree (recommended) - based on traversing widget tree, while it's bit slower than SemanticsTree it's production ready and doesn't have any blocking Flutter SDK issues.
SemanticsTree (experimental) - based on traversing semantic data node tree. Does traverse the tree faster but doesn't support Seo.head(...), Seo.text(style: ...), Seo.link(rel: ...), Seo.html(html: ...)
Sample Usage
You should wrap all your SEO required widgets accordingly within Seo.text(...), Seo.image(...), Seo.link(...) and SEO required pages within Seo.head(...). From personal experience it's more comfortable to create custom AppText, AppImage, AppLink, AppHead base widgets and use those in the project.
Seo.html(
html: '<div>Some raw html</div>',
child: ...,
); // converts to: <div>Some raw html</div>
Head
Seo.head(
tags: [
MetaTag(name: 'title', content: 'Flutter SEO Example'),
LinkTag(rel: 'canonical', href: 'http://www.example.com'),
],
child: ...,
); // converts to: <meta name="title" content="Flutter SEO Example"><link rel="canonical" href="http://www.example.com" />
Warning: Open Graph (og:title, og:description, etc.) and Twitter Card (twitter:title, twitter:description, etc.) will not work. Read more.
Tips
Supporting Open Graph, Twitter Card tags
Facebook, Twitter, etc. simply load index.html and don't execute any JavaScript that webpage contains so we're not able to change meta tags within Dart code. The proposed solution is to create simple Server-Side Rendering which would add Open Graph, Twitter Card tags within index.html before returning it to Client.
Demo
View demo here: https://flutter-seo.netlify.app
PageSpeed Insights
Google Search
Landing page has been indexed and does appear in Search
Remaining pages have Discovered - currently not indexed status. I am investigating why.