twitterCard method

  1. @override
dynamic twitterCard({
  1. required TwitterCard twitterCard,
})
override

Definition of twitter:card meta tag attribute https://developer.twitter.com/en/docs/twitter-for-websites/cards/guides/getting-started Add web mata data of twitterCard attribute Implement the interface

Implementation

@override
twitterCard(
    {
    /// Definition of [twitter:card] meta tag attribute
    required TwitterCard twitterCard}) {
  /// Make switch loop according to twitterCard state
  switch (twitterCard) {
    /// If the case is summary then run the following
    case TwitterCard.summary:

      /// Call the javascript function with summary attribute
      js.context.callMethod('seoNameJS', ['twitter:card', 'summary']);

      /// Break the switch loop if done
      break;

    /// If the case is summaryLargeImage then run the following
    case TwitterCard.summaryLargeImage:

      /// Call the javascript function with summary_large_image attribute
      js.context
          .callMethod('seoNameJS', ['twitter:card', 'summary_large_image']);

      /// Break the switch loop if done
      break;

    /// If the case is app then run the following
    case TwitterCard.app:

      /// Call the javascript function with app attribute
      js.context.callMethod('seoNameJS', ['twitter:card', 'app']);

      /// Break the switch loop if done
      break;

    /// If the case is player then run the following
    case TwitterCard.player:

      /// Call the javascript function with player attribute
      js.context.callMethod('seoNameJS', ['twitter:card', 'player']);

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