सार्वजनिक जानकारी से बना चयन मार्गदर्शन। केवल संदर्भ हेतु।
seo पैकेज एक Flutter प्लगइन है जिसका उद्देश्य वेब एप्लिकेशन के लिए SEO क्षमताओं को बढ़ावा देना है, जिससे मेटा टैग और बॉडी एट्रिब्यूट को डायनामिक रूप से प्रबंधित किया जा सके। यह डेवलपर्स को डार्ट कोड से शीर्षक, विवरण, Open Graph टैग और अन्य SEO-संबंधी सामग्री सेट करने की अनुमति देता है। इससे खोज इंजन को वेब पेज को सही तरीके से इंडेक्स करने में मदद मिलती है, जिससे दृश्यता और रैंकिंग में सुधार होता है। पैकेज Flutter के वेब प्लेटफॉर्म के साथ बिना किसी दिक्कत के एकीकृत होता है और सर्वर-साइड रेंडरिंग के मामलों का समर्थन करता है। ऐसे एप्लिकेशन के लिए यह विशेष रूप से उपयोगी है जिन्हें हाई-लेवल मेटाडेटा नियंत्रण की आवश्यकता होती है बिना हाथ से HTML में बदलाव किए।
उपयोग
डायनामिक मेटा टैग अपडेट्स
सुधारित सर्च इंजन इंडेक्सिंग
सोशल मीडिया शेयरिंग अनुकूलन
सिंगल-पेज एप्लिकेशन SEO
मार्ग के आधार पर सामग्री व्यक्तिगतकरण
सर्वर-पक्ष रेंडरिंग सुसंगतता
मुख्य विशेषताएँ
आसान मेटा टैग प्रबंधन
Open Graph और Twitter कार्ड का समर्थन
गतिशील शीर्षक और विवरण परिवर्तन
क्रॉस-प्लेटफ़ॉर्म वेब समर्थन
न्यूनतम बॉयलरप्लेट
Flutter रूटिंग के साथ एकीकरण
इनके लिए उपयुक्त
वेब के लिए केवल फ्लटर ऐप्स
SEO-फोकस्ड वेब एप्लिकेशन्स
गतिशील सामग्री वाले ऐप्स
खोज दृश्यता को प्राथमिकता देने वाले विकासकर्मी
सोशल मीडिया मेटाडेटा की आवश्यकता वाले प्रोजेक्ट
क्लाइंट-साइड रूटिंग का उपयोग करने वाले ऐप्स
विचार योग्य बातें
मोबाइल प्लेटफॉर्म (Android/iOS) के लिए अनुपयुक्त
बहु-मार्ग परिदृश्यों में सावधानीपूर्वक संचालन की आवश्यकता होती है
वेब प्लेटफॉर्म कार्यक्षमता तक सीमित
पूर्ण SSR फ्रेमवर्क की प्रतिस्थापन नहीं करता है
उन्नत एसईओ के लिए हाथ से कॉन्फ़िगरेशन की आवश्यकता होती है
सही पृष्ठ संरचना के साथ सबसे अच्छा उपयोग किया जाता है
मूल 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.