publishEmbeddedTweet abstract method

Future<EmbeddedTweet> publishEmbeddedTweet({
  1. required String screenName,
  2. required String tweetId,
  3. int? maxWidth,
  4. bool? hideMedia,
  5. bool? hideThread,
  6. bool? omitScript,
  7. ContentAlign? align,
  8. List<String>? relatedScreenNames,
  9. ContentLanguage? lang,
  10. ContentTheme? theme,
  11. String? linkColor,
  12. TweetWidgetType? widgetType,
  13. bool? dnt,
})

Converts the specified tweet to Embedded Content format.

Parameters

  • screenName: The screen name of the user who has the tweet to be embedded.

  • tweetId: The Tweet ID to be embedded.

  • maxWidth: The maximum width of a rendered Tweet in whole pixels. A supplied value under or over the allowed range will be returned as the minimum or maximum supported width respectively; the reset width value will be reflected in the returned width property. Note that Twitter does not support the oEmbed max height parameter. Tweets are fundamentally text, and are therefore of unpredictable height that cannot be scaled like an image or video. Relatedly, the oEmbed response will not provide a value for height. Implementations that need consistent heights for Tweets should refer to the hideThread and hideMedia parameters below.

  • hideMedia: When set to true, links in a Tweet are not expanded to photo, video, or link previews.

  • hideThread: When set to true, a collapsed version of the previous Tweet in a conversation thread will not be displayed when the requested Tweet is in reply to another Tweet.

  • omitScript: When set to true, the <script> responsible for loading widgets.js will not be returned. Your webpages should include their own reference to widgets.js for use across all Twitter widgets including Embedded Tweets.

  • align: Specifies whether the embedded Tweet should be floated left, right, or center in the page relative to the parent element.

  • relatedScreenNames: A list of Twitter screen names related to your content. This value will be forwarded to Tweet action intents if a viewer chooses to reply, like, or retweet the embedded Tweet.

  • lang: Request returned HTML and a rendered Tweet in the specified Twitter language supported by embedded Tweets.

  • theme: When set to dark, the Tweet is displayed with light text over a dark background.

  • linkColor: Adjust the color of Tweet text links with a hexadecimal color value.

  • widgetType: Set to TweetWidgetType.video to return a Twitter Video embed for the given Tweet.

  • dnt: When set to true, the Tweet and its embedded page on your site are not used for purposes that include personalized suggestions and personalized ads.

Reference

Implementation

Future<EmbeddedTweet> publishEmbeddedTweet({
  required String screenName,
  required String tweetId,
  int? maxWidth,
  bool? hideMedia,
  bool? hideThread,
  bool? omitScript,
  ContentAlign? align,
  List<String>? relatedScreenNames,
  ContentLanguage? lang,
  ContentTheme? theme,
  String? linkColor,
  TweetWidgetType? widgetType,
  bool? dnt,
});