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

套件詳情v1.0.0

injecteo

IoC 模式的服务定位器。匯出 injecteo_generator 使用的註解和抽象類別。

AndroidiOSWebmacOSWindowsLinux
近 30 天下載
10
喜歡數
31
Pub 分數
150

安裝套件

flutter pub add injecteo

套件介紹

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

Injecteo 是一個為依賴注入(IoC)模式設計的服務定位器,可幫助 Flutter 應用高效管理依賴關係。它利用註解和抽象類,透過 injecteo_generator 產生樣板程式碼,簡化依賴項的註冊與取得。該套件支援 Android、iOS、Web、macOS、Windows 與 Linux 等多個平台,適用於跨平台開發。透過減少手動依賴連結,Injecteo 提升了程式碼的可維護性與可測試性。

適用情境

  • 管理應用範圍內的依賴項
  • 使用模擬依賴項簡化單元測試
  • 啟用模組化應用架構
  • 在大型應用程式中支援依賴注入
  • 在複雜專案中促進關注點分離

主要特色

  • 透過 injecteo_generator 進行程式碼產生
  • 依賴宣告的註解
  • 抽象類別支援靈活設定
  • 跨平台相容性
  • 最小的執行時開銷

適合對象

  • 需要結構化依賴管理的大型Flutter應用
  • 使用 IoC 模式的團隊
  • 尋求自動化依賴注入的開發者
  • 強調測試性與模組化的專案
  • 針對多個平台的應用程式

使用建議

  • 需要使用代碼生成器(injecteo_generator)
  • 新用戶對IoC不熟悉時的學習曲線
  • 除錯產生的程式碼時可能出現的複雜性
  • 依賴正確的註解使用以避免執行時錯誤

原始 README

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

injecteo

melos   Test status   pub package   GitHub license  


Nice to see you here, dear Developer. This is a root of injecteo service locator / dependency injection generator project.
Repository contains several folders:

  • packages

    • injecteo: Dependency Injection annotations (@singleton, @inject, @InjectionModule, @externalModule), abstract class for ServiceLocator pattern and the implementation using get_it package
    • injecteo_generator: Actual code generator which scans project for injecteo annotations and generate top-level configuration function with additional InjectionModule classes
    • injecteo_models: Internal models used by generator. Represents DependencyConfig with required properties like:
      import name, type and implementation definition
  • example

    • basic: Simple counter app, which shows how to annotate classes for injecteo_generator and configure dependencies
    • feature_packages: Focuses on InjectionModule - a way to split features into multiple packages and integrate them with Melos
    • todeo: Advanced to-do application with multiple dependencies registered for dev and prod environments.

For details, please see each folder README files.

Development

Packages use Melos with usePubspecOverrides: true.
Local packages are linked via Melos-generated pubspec_overrides.yaml.

melos bs
melos run get
melos run generate
melos run format

Before commit

melos run format
melos run test

所屬分類

依賴

依賴清單 2 項

原始碼儲存庫

使用此套件的專案

暫無相關資料。