robots method

  1. @override
dynamic robots({
  1. required RobotsName robotsName,
  2. required String content,
})
override

Definition of robotsName meta tag attribute Definition of content meta tag attribute https://developers.google.com/search/docs/crawling-indexing/robots-meta-tag Add web mata data of robotsName attribute Add web mata data of content attribute Implement the interface

Implementation

@override
robots(
    {
    /// Definition of [robotsName] meta tag attribute
    required RobotsName robotsName,

    /// Definition of [content] meta tag attribute
    required String content}) {
  /// Make switch loop according to robotsName state
  switch (robotsName) {
    /// If the case is google then run the following
    case RobotsName.google:

      /// Call the javascript function with google attribute
      js.context.callMethod('seoRobotsJS', ['google', content]);

      /// Break the switch loop if done
      break;

    /// If the case is googleBot then run the following
    case RobotsName.googleBot:

      /// Call the javascript function with googleBot attribute
      js.context.callMethod('seoRobotsJS', ['googlebot', content]);

      /// Break the switch loop if done
      break;

    /// If the case is googleBotNews then run the following
    case RobotsName.googleBotNews:

      /// Call the javascript function with googleBotNews attribute
      js.context.callMethod('seoRobotsJS', ['googlebot-news', content]);

      /// Break the switch loop if done
      break;

    /// If the case is googleSiteVerification then run the following
    case RobotsName.googleSiteVerification:

      /// Call the javascript function with googleSiteVerification attribute
      js.context
          .callMethod('seoNameJS', ['google-site-verification', content]);

      /// Break the switch loop if done
      break;

    /// If the case is robots then run the following
    case RobotsName.robots:

      /// Call the javascript function with robots attribute
      js.context.callMethod('seoRobotsJS', ['robots', content]);

      /// Break the switch loop if done
      break;
  }
}