搜尋套件、儲存庫與 APP 分類

套件詳情v8.7.1

chopper

Chopper 是一個使用 source_gen 的 http 客戶端產生器,靈感來自 Retrofit

AndroidiOSWebmacOSWindowsLinux
近 30 天下載
15.1萬
喜歡數
917
Pub 分數
160

安裝套件

flutter pub add chopper

套件介紹

根據套件公開資料產生的選型評估,僅供參考。

Chopper 是一個功能強大的 Dart 與 Flutter HTTP 客戶端產生器,基於 source_gen 建構。受到 Retrofit 的啟發,它透過從註解產生類型安全的客戶端,簡化了 API 整合。開發者使用簡單的裝飾器定義端點,Chopper 會自動產生對應的客戶端程式碼,減少重複程式碼並提升可維護性。它支援序列化、攔截器與模組化設計,非常適合跨多個平台的結構化 RESTful 服務。

適用情境

  • 在Flutter應用中建構類型安全的REST API
  • 從註解自動產生HTTP客戶端
  • 與 JSON 序列化整合
  • 建立可重複使用且可維護的網路層
  • 支援多平台應用程式

主要特色

  • 基於註解的 API 定義
  • 透過 source_gen 自動產生客戶端程式碼
  • 內建的 JSON 序列化支援
  • 用於請求/回應操作的攔截器系統
  • 模組化和可擴展的架構

適合對象

  • 尋求乾淨 HTTP 客戶端模式的 Flutter 開發者
  • 使用具有一致資料模型的REST API的團隊
  • 需要減少網路相關樣板程式碼的項目
  • 熟悉 Retrofit 或類似庫的開發者
  • 適用於 Android、iOS、Web、macOS、Windows 和 Linux 的應用程式

使用建議

  • 需要了解 source_gen 和 build runners
  • 初始設定涉及建構設定
  • 僅限 REST 風格的 API(不包含 GraphQL)
  • 由於程式碼產生,建置時間可能增加
  • 依賴外部序列化庫,例如 json_annotation

原始 README

以下為關聯原始碼儲存庫的 README 原文快照,最新內容請造訪原始碼儲存庫。

Chopper

All Contributors

pub package Dart CI codecov

Chopper is an http client generator for Dart and Flutter using source_gen and inspired by Retrofit.

Documentation

Installation

Please refer to the installation guide at pub.dev or in the Getting started document.

Examples

Issue Tracker

Contributors ✨

Thanks goes to these wonderful people (emoji key):


Hadrien Lejard

💻 👀 ⚠️ 📖

István Juhos

💻 👀 ⚠️ 📖

Klemen Tusar

💻 👀 ⚠️ 📖

Ivan Terekhin

💻 👀 ⚠️ 📖

Job Guldemeester

💻 👀 ⚠️ 📖

Eugeny Sampir

💻

Uladzimir Paliukhovich

💻

This project follows the all-contributors specification. Contributions of any kind welcome!

所屬分類

依賴

依賴清單 5 項

原始碼儲存庫

使用此套件的專案

所在榜單