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

套件詳情v4.2.1

kiwi_generator

使用 kiwi 包產生依賴注入程式碼,以減少開發時間。

macOSWindowsLinux
近 30 天下載
2880
喜歡數
13
Pub 分數
150

安裝套件

flutter pub add kiwi_generator

套件介紹

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

Kiwi Generator 是一個程式碼產生工具,透過 Kiwi 套件自動設定相依性注入,大幅減少重複程式碼與開發時間。它根據註解產生乾淨、類型安全的注入程式碼,讓 Flutter 應用中的相依性管理更有效率。藉由建置時期的程式碼產生技術,確保效能並降低執行時期的負載。此產生器與 Kiwi DI 架構無縫整合,支援跨平台開發,涵蓋 macOS、Windows 與 Linux。適合尋求簡化相依性管理且無需手動設定的開發者。

適用情境

  • 自動化依賴注入設定
  • 減少大型應用中的樣板程式碼
  • 簡化可測試的架構
  • 啟用類型安全注入
  • 支援可擴充的應用程式結構

主要特色

  • 建構時程式碼產生
  • 基於註解的設定
  • 類型安全的依賴項解析
  • 與 Kiwi 的無縫整合
  • 跨平台支援

適合對象

  • 大規模 Flutter 專案
  • 重視可維護性的團隊
  • 使用依賴注入的開發者
  • 需要可測試架構的應用程式
  • 旨在減少手動設定的專案

使用建議

  • 需要理解 Kiwi DI 原則
  • 需要 build_runner 進行代碼生成
  • 可能會增加初始建構時間
  • 與手動依賴注入相比,自訂選項有限
  • 取決於 Kiwi 套件版本相容性

原始 README

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

kiwi

kiwi kiwi_generator dart_kiwi_example flutter_kiwi_example

Logo

A simple yet efficient IoC container for Dart and Flutter, coupled with a powerful generator to allow you to write less code.

The container does not rely on reflection, it's just a Map, so it's fast.

While using the generator, only constructor injection is supported.

Kiwi

Pub

Source Code

The core package providing the IoC container and the annotations which has no dependencies.

Import it into your pubspec dependencies: section.

Kiwi Generator

Pub

Source Code

The package providing the generator.

Import it into your pubspec dev_dependencies: section.

Dart Kiwi Example

Source Code

An example showing how to setup kiwi and kiwi_generator inside a Dart CLI project.

Flutter Kiwi Example

Source Code

An example showing how to setup kiwi and kiwi_generator inside a Flutter project.

Contributions

Feel free to contribute to this project.

If you find a bug or want a feature, but don't know how to fix/implement it, please fill an issue.
If you fixed a bug or implemented a new feature, please send a pull request.

所屬分類

依賴

依賴清單 9 項

原始碼儲存庫

使用此套件的專案