패키지, 저장소 및 앱 카테고리 검색

패키지 상세v0.6.0

dart_twitter_api

Twitter API를 사용하기 위한 Dart 래퍼로, 모든 엔드포인트에 대해 잘 문서화된 인터페이스를 제공합니다.

AndroidiOSWebmacOSWindowsLinux
30일 다운로드
1.1천
좋아요
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 개발자 계정이 필요합니다
  • 레이트 제한이 적용됩니다
  • 적절한 오류 처리가 필요합니다
  • 외부 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 개

소스 저장소

이 패키지를 사용하는 프로젝트