twitter_oembed_api 0.1.0 copy "twitter_oembed_api: ^0.1.0" to clipboard
twitter_oembed_api: ^0.1.0 copied to clipboard

This library provides the easiest way to use the Twitter oEmbed API in Dart and Flutter apps.

example/example.dart

// Copyright 2022 Kato Shinya. All rights reserved.
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided the conditions.

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 with list name.
    final embeddedTimeline = await twitterApi.publishEmbeddedTimeline(
      screenName: 'TwitterDev',
      theme: ContentTheme.dark,
    );

    print(embeddedTimeline.html);
  } on TwitterOEmbedException catch (e) {
    print(e);
  }
}
14
likes
130
points
17
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

This library provides the easiest way to use the Twitter oEmbed API in Dart and Flutter apps.

Repository (GitHub)
View/report issues

License

BSD-3-Clause (license)

Dependencies

freezed_annotation, http, json_annotation

More

Packages that depend on twitter_oembed_api