0 purchases
twitter oembed api
The Easiest Way to Use the Twitter oEmbed API in Dart and Flutter App π¦
1. Guide π
1.1. Features π
1.2. Getting Started β‘
1.2.1. Install Library
1.2.2. Import
1.2.3. Implementation
1.3. Supported Features π
1.3.1. Embedded Tweet
1.3.2. Embedded Timeline
1.4. Contribution π
1.5. Related Libraries π’
1.6. License π
1.7. More Information π§
1. Guide π #
This library provides the easiest way to use the Twitter oEmbed API in Dart and Flutter apps.
Show some β€οΈ and star the repo to support the project.
1.1. Features π #
1.2. Getting Started β‘ #
1.2.1. Install Library #
With Dart:
dart pub add twitter_oembed_api
copied to clipboard
With Flutter:
flutter pub add twitter_oembed_api
copied to clipboard
1.2.2. Import #
import 'package:twitter_oembed_api/twitter_oembed_api';
copied to clipboard
1.2.3. Implementation #
import 'package:twitter_oembed_api/twitter_oembed_api.dart';
Future<void> main() async {
final twitterApi = TwitterOEmbedApi();
try {
// You can get the embedded tweet by specifying the tweet ID.
final embeddedTweet = await twitterApi.publishEmbeddedTweet(
screenName: 'Interior',
tweetId: '507185938620219395',
maxWidth: 550,
align: ContentAlign.center,
);
print(embeddedTweet.html);
// You can get the embedded timeline by specifying the screen name.
// Or the embedded timeline of the list.
final embeddedTimeline = await twitterApi.publishEmbeddedTimeline(
screenName: 'TwitterDev',
theme: ContentTheme.dark,
);
print(embeddedTimeline.html);
} on TwitterOEmbedException catch (e) {
print(e);
}
}
copied to clipboard
1.3. Supported Features π #
1.3.1. Embedded Tweet #
Method
publishEmbeddedTweet
Embedded Tweets bring your pick of content from Twitter into your website articles. An embedded tweet includes photos, video and cards media created for display on Twitter, and can even stream live video from Periscope. All aspects of Twitterβs display requirements are handled for you by using our tools; author attribution, Tweet actions, hashtags, mentions, and other key components of the Twitter experience.
The returned HTML snippet will be automatically recognized as an embedded tweet when Twitter's widget JavaScript is included on the page.
With this feature, you can easily show the following beautiful tweet view in the Flutter app.
1.3.2. Embedded Timeline #
Method
publishEmbeddedTimeline
Embedded timelines are an easy way to embed Tweets on your website in a compact, linear view. Choose between a profile timeline to get the latest Tweets from a Twitter account, or a List timeline containing a curated list of Twitter accounts.
An embedded timeline consists of two parts: including an embed code that links your webpage to the timeline on Twitter.com, and the Twitter for Websites JavaScript to transform the link into a fully-rendered timeline.
With this feature, you can easily show the following beautiful timeline view in the Flutter app.
1.4. Contribution π #
If you would like to contribute to twitter_oembed_api, please create an issue or create a Pull Request.
There are many ways to contribute to the OSS. For example, the following subjects can be considered:
There are request parameters or response fields that are not implemented.
Documentation is outdated or incomplete.
Have a better way or idea to achieve the functionality.
etc...
You can see more details from resources below:
Contributor Covenant Code of Conduct
Contribution Guidelines
Style Guide
Or you can create a discussion if you like.
Feel free to join this development, diverse opinions make software better!
1.5. Related Libraries π’ #
We also provide the following powerful libraries related to Twitter! π¦
Library
Description
Links
twitter_api_v2
The easiest way to using Twitter API v2.0 with Dart and Flutter. Strong support for all v2.0 endpoints.
GitHub Pub.dev
twitter_oauth2_pkce
This is the easiest way to obtain a Twitter access token using the OAuth 2.0 PKCE method.
GitHub Pub.dev
twitter_cards
This library provides the easiest way to integrate Twitter Cards into your Flutter Web app.
GitHub Pub.dev
1.6. License π #
All resources of twitter_oembed_api is provided under the BSD-3 license.
Copyright 2022 Kato Shinya. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided the conditions.
copied to clipboard
Note
License notices in the source are strictly validated based on .github/header-checker-lint.yml. Please check header-checker-lint.yml for the permitted standards.
1.7. More Information π§ #
twitter_oembed_api was designed and implemented by Kato Shinya (@myConsciousness).
Creator Profile
License
API Document
Release Note
Bug Report
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.