{"id":19987491,"url":"https://github.com/schibsted/tweet_ui","last_synced_at":"2025-08-20T20:31:56.420Z","repository":{"id":35061422,"uuid":"201915432","full_name":"schibsted/tweet_ui","owner":"schibsted","description":"Flutter package to display tweets from a Twitter API JSON (v1 or v2) on Android and iOS. Support for Tweets with 1-4 photos, Video, GIFs, hashtags, mentions, symbols, urls, quoted Tweets and retweets.","archived":false,"fork":false,"pushed_at":"2023-07-23T16:22:39.000Z","size":50183,"stargazers_count":81,"open_issues_count":7,"forks_count":45,"subscribers_count":9,"default_branch":"dev","last_synced_at":"2024-12-06T02:34:08.863Z","etag":null,"topics":["android","flutter","ios","tweets"],"latest_commit_sha":null,"homepage":"https://pub.dev/packages/tweet_ui","language":"Dart","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/schibsted.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2019-08-12T11:16:32.000Z","updated_at":"2024-11-08T22:23:04.000Z","dependencies_parsed_at":"2022-08-08T04:15:48.120Z","dependency_job_id":"544547fa-cc83-4ee2-9c13-5ccae09de29e","html_url":"https://github.com/schibsted/tweet_ui","commit_stats":{"total_commits":136,"total_committers":16,"mean_commits":8.5,"dds":"0.47058823529411764","last_synced_commit":"07b0a7fdcddf6f5cc126299daaf1499011ae35c2"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/schibsted%2Ftweet_ui","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/schibsted%2Ftweet_ui/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/schibsted%2Ftweet_ui/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/schibsted%2Ftweet_ui/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/schibsted","download_url":"https://codeload.github.com/schibsted/tweet_ui/tar.gz/refs/heads/dev","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230454424,"owners_count":18228392,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android","flutter","ios","tweets"],"created_at":"2024-11-13T04:36:36.606Z","updated_at":"2024-12-19T15:07:53.098Z","avatar_url":"https://github.com/schibsted.png","language":"Dart","funding_links":[],"categories":[],"sub_categories":[],"readme":"# tweet_ui\n\nFlutter Tweet UI - Flutter package that is inspired by\n[twitter-kit-android](https://github.com/twitter-archive/twitter-kit-android). Works on iOS and Android.\n\n## Getting Started\n\nTo use this package add it to the pubspec.yaml file:\n\n`tweet_ui: \u003clatest_version\u003e`\n\nimport it:\n\n`import 'package:tweet_ui/tweet_ui.dart';`\n\nIf you want to show tweets with videos: check the\n[better_player installation]( https://jhomlala.github.io/betterplayer/#/install) site\n\n\u003e Video/GIF Tweets don't work on iOS simulators ([video_player ios instructions](https://pub.dev/packages/video_player#ios))\n\n\nfinally, create a `TweetView` from a JSON:\n\n### API V1.1\n```dart\nTweetView.fromTweetV1(\n    TweetV1Response.fromRawJson(\n        jsonFromTwitterAPI\n        // {\"created_at\": \"Mon Nov 12 13:00:38 +0000 2018\", \"id\": 1061967001177018368, ...\n    )\n);\n```\n### API V2\n```dart\nTweetView.fromTweetV2(\n    TweetV2Response.fromRawJson(\n        jsonFromTwitterAPI\n        // {\"data\": [\"created_at\": \"2020-09-18T18:36:15.000Z\", \"id\": \"1061967001177018368\", ...\n        // or\n        // {\"data\": {\"created_at\": \"2020-09-18T18:36:15.000Z\", \"id\": \"1061967001177018368\", ...\n    )\n);\n```\n\nor a `CompactTweetView`,\n\n### API V1.1\n```dart\nCompactTweetView.fromTweetV1(\n    TweetV1Response.fromRawJson(\n        jsonFromTwitterAPI\n        // {\"created_at\": \"Mon Nov 12 13:00:38 +0000 2018\", \"id\": 1061967001177018368, ...\n    )\n);\n```\n\n### API V2\n```dart\nCompactTweetView.fromTweetV2(\n    TweetV2Response.fromRawJson(\n        jsonFromTwitterAPI\n        // {\"data\": [\"created_at\": \"2020-09-18T18:36:15.000Z\", \"id\": \"1061967001177018368\", ...\n        // or\n        // {\"data\": {\"created_at\": \"2020-09-18T18:36:15.000Z\", \"id\": \"1061967001177018368\", ...\n    )\n);\n```\n\nor a `EmbeddedTweetView`.\n\n### API V1.1\n```dart\nEmbeddedTweetView.fromTweetV1(\n    TweetV1Response.fromRawJson(\n        jsonFromTwitterAPI\n        // {\"created_at\": \"Mon Nov 12 13:00:38 +0000 2018\", \"id\": 1061967001177018368, ...\n    )\n  darkMode: true,\n)\n```\n\n### API V2\n```dart\nEmbeddedTweetView.fromTweetV2(\n    TweetV2Response.fromRawJson(\n      jsonFromTwitterAPI\n      // {\"data\": [\"created_at\": \"2020-09-18T18:36:15.000Z\", \"id\": \"1061967001177018368\", ...\n      // or\n      // {\"data\": {\"created_at\": \"2020-09-18T18:36:15.000Z\", \"id\": \"1061967001177018368\", ...\n    )\n    darkMode: true,\n)\n```\n\nThere is also a special `QuoteTweetView` that is embedded in a `TweetView` or a `CompactTweetView` or a\n`EmbeddedTweetView`. This depends if a Tweet has a `quoted_status` value in the JSON.\n\n## What tweet view should I create?\n\n`TweetView` and `CompactTweetView` are more customisable, but `EmbeddedTweetView` looks more modern. Check the screenshots [below](https://github.com/schibsted/tweet_ui#example-of-supported-view-and-media-types).\n\n## Twitter API V2 know problems\nIn current version of twitter API (V2 as of 14.02.2022) it is not possible to get video url in tweet response.\nSee the following links for more info:\n- [Twitter community](https://twittercommunity.com/t/where-would-i-find-the-direct-link-to-an-mp4-video-posted-in-v2/146933/2)\n- [Twitter dev feedback](https://twitterdevfeedback.uservoice.com/forums/930250-twitter-api/suggestions/41291761-media-fields-should-return-url-for-gifs-or-videos)\n\nAll other video fields (like size or duration) are available in the response. \nThis means that videos will not work for now.\n\n## Need more information? Check our wiki pages!\n\n[Colors \u0026 styling](https://github.com/schibsted/tweet_ui/wiki/Colors-\u0026-styling)\n\n[Custom callbacks](https://github.com/schibsted/tweet_ui/wiki/Custom-callbacks)\n\n[Custom date format](https://github.com/schibsted/tweet_ui/wiki/Custom-date-format)\n\n[Video player options](https://github.com/schibsted/tweet_ui/wiki/Video-player-options)\n\n## Example of supported view and media types:\n\n### Standard tweet views\n\n| Media type |                                               TweetView                                               |                                           CompactTweetView                                           | EmbeddedTweetView                                                                                     |\n|:----------:|:-----------------------------------------------------------------------------------------------------:|:----------------------------------------------------------------------------------------------------:|:------------------------------------------------------------------------------------------------------|\n|  1 photo   | ![img](https://raw.githubusercontent.com/schibsted/tweet_ui/dev/screenshots/standard_1_photo.png)  | ![img](https://raw.githubusercontent.com/schibsted/tweet_ui/dev/screenshots/compact_1_photo.png)  | ![img](https://raw.githubusercontent.com/schibsted/tweet_ui/dev/screenshots/embedded_1_photo.png)  |\n|  2 photos  | ![img](https://raw.githubusercontent.com/schibsted/tweet_ui/dev/screenshots/standard_2_photos.png) | ![img](https://raw.githubusercontent.com/schibsted/tweet_ui/dev/screenshots/compact_2_photos.png) | ![img](https://raw.githubusercontent.com/schibsted/tweet_ui/dev/screenshots/embedded_2_photos.png) |\n|  3 photos  | ![img](https://raw.githubusercontent.com/schibsted/tweet_ui/dev/screenshots/standard_3_photos.png) | ![img](https://raw.githubusercontent.com/schibsted/tweet_ui/dev/screenshots/compact_3_photos.png) | ![img](https://raw.githubusercontent.com/schibsted/tweet_ui/dev/screenshots/embedded_3_photos.png) |\n|  4 photos  | ![img](https://raw.githubusercontent.com/schibsted/tweet_ui/dev/screenshots/standard_4_photos.png) | ![img](https://raw.githubusercontent.com/schibsted/tweet_ui/dev/screenshots/compact_4_photos.png) | ![img](https://raw.githubusercontent.com/schibsted/tweet_ui/dev/screenshots/embedded_4_photos.png) |\n|   video    |  ![img](https://raw.githubusercontent.com/schibsted/tweet_ui/dev/screenshots/standard_video.png)   |  ![img](https://raw.githubusercontent.com/schibsted/tweet_ui/dev/screenshots/compact_video.png)   | ![img](https://raw.githubusercontent.com/schibsted/tweet_ui/dev/screenshots/embedded_video.png)    |\n|    GIF     |   ![img](https://raw.githubusercontent.com/schibsted/tweet_ui/dev/screenshots/standard_gif.png)    |   ![img](https://raw.githubusercontent.com/schibsted/tweet_ui/dev/screenshots/compact_gif.png)    | ![img](https://raw.githubusercontent.com/schibsted/tweet_ui/dev/screenshots/embedded_gif.png)      |\n\n### Quoted tweet views\n\n| Media type |                                                  TweetView                                                  |                                              CompactTweetView                                              | EmbeddedTweetView                                                                                           |\n|:----------:|:-----------------------------------------------------------------------------------------------------------:|:----------------------------------------------------------------------------------------------------------:|:------------------------------------------------------------------------------------------------------------|\n|  1 photo   | ![img](https://raw.githubusercontent.com/schibsted/tweet_ui/dev/screenshots/standard_quote_1_photo.png)  | ![img](https://raw.githubusercontent.com/schibsted/tweet_ui/dev/screenshots/compact_quote_1_photo.png)  | ![img](https://raw.githubusercontent.com/schibsted/tweet_ui/dev/screenshots/embedded_quote_1_photo.png)  |\n|  2 photos  | ![img](https://raw.githubusercontent.com/schibsted/tweet_ui/dev/screenshots/standard_quote_2_photos.png) | ![img](https://raw.githubusercontent.com/schibsted/tweet_ui/dev/screenshots/compact_quote_2_photos.png) | ![img](https://raw.githubusercontent.com/schibsted/tweet_ui/dev/screenshots/embedded_quote_2_photos.png) |\n|  3 photos  | ![img](https://raw.githubusercontent.com/schibsted/tweet_ui/dev/screenshots/standard_quote_3_photos.png) | ![img](https://raw.githubusercontent.com/schibsted/tweet_ui/dev/screenshots/compact_quote_3_photos.png) | ![img](https://raw.githubusercontent.com/schibsted/tweet_ui/dev/screenshots/embedded_quote_3_photos.png) |\n|  4 photos  | ![img](https://raw.githubusercontent.com/schibsted/tweet_ui/dev/screenshots/standard_quote_4_photos.png) | ![img](https://raw.githubusercontent.com/schibsted/tweet_ui/dev/screenshots/compact_quote_4_photos.png) | ![img](https://raw.githubusercontent.com/schibsted/tweet_ui/dev/screenshots/embedded_quote_4_photos.png) |\n|   video    |  ![img](https://raw.githubusercontent.com/schibsted/tweet_ui/dev/screenshots/standard_quote_video.png)   |  ![img](https://raw.githubusercontent.com/schibsted/tweet_ui/dev/screenshots/compact_quote_video.png)   | ![img](https://raw.githubusercontent.com/schibsted/tweet_ui/dev/screenshots/embedded_quote_video.png)    |\n|    GIF     |   ![img](https://raw.githubusercontent.com/schibsted/tweet_ui/dev/screenshots/standard_quote_gif.png)    |   ![img](https://raw.githubusercontent.com/schibsted/tweet_ui/dev/screenshots/compact_quote_gif.png)    | ![img](https://raw.githubusercontent.com/schibsted/tweet_ui/dev/screenshots/embedded_quote_gif.png)      |\n\n\u003e Sample tweets use real-life tweet ids but for example purposes, their content was changed.\n\n***\n\n#### Thanks for contributing: [dasmikko](https://github.com/dasmikko), [jamesblasco](https://github.com/jamesblasco), [tristan-vrt](https://github.com/tristan-vrt), [daver123](https://github.com/daver123), [ercadev](https://github.com/ercadev), [ivanjpg](https://github.com/ivanjpg), [escamoteur](https://github.com/escamoteur), [ndahlquist](https://github.com/ndahlquist), [wszeborowskimateusz](https://github.com/wszeborowskimateusz), [robertmrobo](https://github.com/robertmrobo)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fschibsted%2Ftweet_ui","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fschibsted%2Ftweet_ui","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fschibsted%2Ftweet_ui/lists"}