seo 패키지는 웹 애플리케이션의 SEO 기능을 향상시키기 위해 설계된 Flutter 플러그인으로, 메타 태그와 본문 속성을 동적으로 관리할 수 있도록 합니다. 개발자는 Dart 코드에서 제목, 설명, Open Graph 태그 및 기타 SEO 관련 콘텐츠를 직접 설정할 수 있습니다. 이를 통해 검색 엔진이 웹 페이지를 올바르게 인덱싱할 수 있어 가시성과 순위가 향상됩니다. 이 패키지는 Flutter의 웹 플랫폼과 원활하게 통합되며 서버 사이드 렌더링 고려사항도 지원합니다. 수동으로 HTML을 조작하지 않고도 풍부한 메타데이터 제어가 필요한 앱에 특히 유용합니다.
사용 사례
동적 메타 태그 업데이트
개선된 검색 엔진 인덱싱
소셜 미디어 공유 최적화
단페이지 애플리케이션 SEO
경로 기반 콘텐츠 개인화
서버 사이드 렌더링 호환성
주요 기능
메타 태그 관리를 쉽게
Open Graph 및 Twitter 카드 지원
동적 제목 및 설명 변경
크로스 플랫폼 웹 지원
최소한의 보일러플레이트
Flutter 라우팅과의 통합
적합한 대상
웹 전용 플러터 앱
SEO 중심 웹 애플리케이션
동적 콘텐츠를 가진 앱
검색 가시성을 우선시하는 개발자
소셜 미디어 메타데이터가 필요한 프로젝트
클라이언트 측 라우팅을 사용하는 앱
고려 사항
모바일 플랫폼(안드로이드/아이오스)에 적용되지 않음
다중 경로 시나리오에서는 주의 깊은 조작이 필요합니다
웹 플랫폼 기능에 제한됨
완전한 SSR 프레임워크를 대체하지 않습니다
고급 SEO를 위해 수동 구성이 필요합니다
적절한 페이지 구조와 함께 사용하는 것이 가장 좋습니다
원본 README
연결된 소스 저장소의 README 원문 스냅샷입니다. 최신 내용은 저장소에서 확인하세요.
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.