Pakete, Repositories und App-Kategorien suchen

Paketdetailsv0.6.0

dart_twitter_api

Ein Dart-Wraper für die Verwendung der Twitter-API mit gut dokumentierten Schnittstellen für jeden Endpunkt.

AndroidiOSWebmacOSWindowsLinux
30-Tage-Downloads
1080
Likes
44
Pub-Punkte
150

Paket installieren

flutter pub add dart_twitter_api

Paketübersicht

Aus öffentlichen Paketdaten erstellte Orientierung.

Ein Dart-Paket, das eine gut dokumentierte Wrapper-Funktion für die Twitter-API bereitstellt und eine nahtlose Integration mit Flutter-Anwendungen auf mehreren Plattformen ermöglicht. Es bietet klare Schnittstellen für alle Twitter-API-Endpunkte und vereinfacht Authentifizierung, Datenabruf und Veröffentlichungsfunktionen. Speziell für Entwickler konzipiert, die soziale Medienfunktionen wie das Abrufen von Tweets, Benutzerinteraktionen und Echtzeit-Updates in ihren Apps implementieren möchten. Das Paket unterstützt Android, iOS, Web, macOS, Windows und Linux und gewährleistet breite Kompatibilität. Sein strukturierter Ansatz reduziert Boilerplate-Code und verbessert die Wartbarkeit des Codes.

Anwendungsfälle

  • Lade Tweets und Zeitachsen
  • Benutzerprofilverwaltung
  • Beiträge und Antworten auf Tweets
  • Echtzeit-Feedaktualisierungen
  • Social Media Analyse
  • Twitter-Anmeldung integrieren

Hauptmerkmale

  • Umfassende Endpunktabdeckung
  • Gut dokumentierte APIs
  • Plattformübergreifende Unterstützung
  • Authentifizierungshilfen
  • Typsichere Anfrage-/Antwortmodelle
  • Aktive GitHub-Wartung

Geeignet für

  • Flutter-Entwickler, die soziale Apps bauen
  • Apps, die eine Twitter-Integration erfordern
  • Projekte, die Mehrplattformunterstützung erfordern
  • Entwickler, die saubere Code-Struktur priorisieren
  • Teams, die OAuth-Workflows verwenden

Hinweise

  • Benötigt ein Twitter-Entwicklerkonto
  • Geschwindigkeitsbegrenzungen gelten
  • Erforderliche Fehlerbehandlung
  • Abhängig von der Stabilität der externen API
  • Möglicherweise ist Logik zum Aktualisieren des Tokens erforderlich

Original-README

Originaler README-Schnappschuss aus dem verknüpften Quell-Repository. Aktuelle Inhalte finden Sie im Repository.

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

Kategorien

Abhängigkeiten

Abhängigkeiten 4 Einträge

Quell-Repository

Projekte, die dieses Paket verwenden