パッケージ、リポジトリ、アプリカテゴリを検索

パッケージ詳細v0.6.0

dart_twitter_api

Twitter API を使用するための Dart ラッパーで、各エンドポイントに対して明確にドキュメント化されたインターフェースを提供します。

AndroidiOSWebmacOSWindowsLinux
30日間ダウンロード
1080
いいね数
44
Pub ポイント
150

パッケージをインストール

flutter pub add dart_twitter_api

パッケージ概要

公開情報に基づく選定ガイドです。参考としてご利用ください。

Twitter API 用のドキュメントが充実したラッパーを提供するDartパッケージで、複数のプラットフォームに対応するFlutterアプリへのシームレスな統合を可能にします。すべてのTwitter APIエンドポイントに対して明確なインターフェースを提供し、認証、データ取得、投稿機能の簡素化を実現します。ツイートの取得、ユーザーとのインタラクション、リアルタイム更新といったソーシャルメディア機能をアプリ内に構築したい開発者向けに設計されています。Android、iOS、Web、macOS、Windows、Linuxをサポートしており、広範な互換性を確保しています。構造的なアプローチによりボイラープレートコードを削減し、コードの保守性を向上させます。

用途

  • ツイートとタイムラインを取得中
  • ユーザープロファイル管理
  • ツイートの投稿と返信
  • リアルタイムフィードの更新
  • ソーシャルメディア分析
  • Twitterログインの統合

主な機能

  • 包括的なエンドポイントカバレッジ
  • ドキュメントが整ったAPI
  • クロスプラットフォーム対応
  • 認証ヘルパー
  • 型安全なリクエスト/レスポンスモデル
  • アクティブなGitHubメンテナンス

適している対象

  • ソーシャルアプリを構築するFlutter開発者
  • Twitter統合を必要とするアプリ
  • マルチプラットフォーム対応が必要なプロジェクト
  • クリーンなコード構造を重視する開発者
  • OAuthワークフローを使用するチーム

注意事項

  • Twitter Developerアカウントが必要です
  • レート制限が適用されます
  • 適切なエラー処理が必要です
  • 外部APIの安定性に依存
  • トークンの更新ロジックが必要になる場合があります

元の README

関連するソースリポジトリの README 原文のスナップショットです。最新の内容はリポジトリをご覧ください。

A Dart wrapper for the Twitter API v1.1

pub test

This dart package provides a well documented wrapper for the Twitter v1.1 API.

To access the v2 endpoints, check out twitter-api-v2.

Why use this package?

To make the usage as convenient and comfortable as possible, this package provides interfaces for the various endpoints of the Twitter API. Documentation for each request is available as dart docs and each request's parameters can be changed as named parameters.

The various data structures returned by Twitter are parsed into data models in an isolate.

Example usage

example

Twitter API key

Get your Twitter API key here.

Features

Implemented endpoints

The implemented API endpoints are available as methods in the corresponding service. The request parameters can be set through named parameters and the response will be parsed into a data object for maximum convenience.

Find a list of implemented endpoints here.


If an API endpoint is not yet implemented, a request can be made to that endpoint by manually using the TwitterClient from the TwitterApi object.

See Making a custom request to the Twitter API for an example.

Error handling

Requests made by the client can throw the following errors:

  • TimeoutException when a request hasn't returned a response for some time (defaults to 10s, can be changed in the TwitterClient).

  • Response when the received response does not have a 2xx status code. Most responses include additional error information that can be parsed manually from the response's body. Check out the Twitter Developer documentation of the endpoint for possible error responses (Hyperlinked in the dart doc for each endpoint).

  • Other unexpected errors in unlikely events (for example when parsing the response).


For an example of uploading media files to Twitter, see Attaching media to a Tweet.

Development

Contribution

I appreciate any contributions to this package. Any not yet implemented endpoints can be added similarly to the other implementations. Feel free to reach out to me to ask any questions.

Please make sure dartanalyzer doesn't report any problems before opening a pull request.

Miscellaneous
  • To generate json_serializable models
    • dart run build_runner build --delete-conflicting-outputs

カテゴリー

依存関係

依存関係一覧 4 件

ソースリポジトリ

このパッケージを使用しているプロジェクト