flutter_seo 0.0.1 copy "flutter_seo: ^0.0.1" to clipboard
flutter_seo: ^0.0.1 copied to clipboard

Flutter SEO package

Features #

You can use the flutter_seo package to add tags to your html, which you can use to try SEO optimization.

Usage #

Follow the example below to add tags. to /example folder.

import 'package:flutter/material.dart';
import 'package:flutter_seo/flutter_seo.dart';

void main() async {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  MyApp({super.key});

  final RouteObserver<PageRoute<dynamic>> routeObserver = SeoRouteObserver();

  @override
  Widget build(BuildContext context) {
    BodyTagUtil.init();
    addMetaTag();
    return MaterialApp(
      navigatorObservers: [routeObserver],
      title: '',
      theme: ThemeData(
        colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
        useMaterial3: true,
      ),
      home: Scaffold(
        body: Column(
          children: [
            ElevatedButton(
                onPressed: () {
                  BodyTagUtil.update();
                },
                child: const Text("Body HTML Update ")),
            const Text("Check 1").seoH1,
            const Text("Check 2").seoH3,
            const Text("Check 3").seoH5,
          ],
        ),
      ),
    );
  }

  void addMetaTag() {
    HeadTagUtil.add("name", "theme-color", "#FFFFFF");
    HeadTagUtil.add("name", "keywords", "IT, Flutter");
  }
}