パッケージ、リポジトリ、アプリカテゴリを検索

パッケージ詳細v5.0.1

kiwi

Dart および Flutter 向けのシンプルで効率的な依存関係挿入コンテナ(kiwi_generator パッケージと連携可能)。

AndroidiOSWebmacOSWindowsLinux
30日間ダウンロード
1.3万
いいね数
173
Pub ポイント
160

パッケージをインストール

flutter pub add kiwi

パッケージ概要

公開情報に基づく選定ガイドです。参考としてご利用ください。

Kiwi は、Dart および Flutter 向けの軽量で効率的な依存関係挿入(DI)コンテナであり、アプリケーション内の依存関係の管理を簡素化することを目的としています。開発者が最小限のボイラープレートで依存関係を登録・解決できるようにし、kiwi_generator パッケージを通じて手動およびコード生成による登録をサポートしています。Kiwi は Android、iOS、Web、macOS、Windows、Linux といったすべての主要プラットフォームにシームレスに統合され、スケーラブルで保守性の高いアプリに最適です。シンプルな API により、依存関係のモック化や置き換えが容易になり、クリーンアーキテクチャとテスト可能性を促進します。

用途

  • 大規模なFlutterアプリにおけるサービス依存関係の管理
  • モック依存関係を使用したユニットテストとウィジェットテストの簡素化
  • 明確な関心事の分離によるモジュール型アプリアーキテクチャの有効化
  • 依存関係ライフサイクル管理のサポート
  • Provider や Riverpod などの状態管理ソリューションとの統合
  • 複雑な依存関係グラフのコード生成を支援する

主な機能

  • 軽量で高速なDIコンテナ
  • kiwi_generator を通じたコード生成をサポート
  • プラットフォームに依存しない(すべてのFlutter対応プラットフォームで動作)
  • 既存のFlutterプロジェクトとの簡単な統合
  • 柔軟な依存関係ライフサイクル制御
  • 依存関係登録のための洗練された読みやすい構文

適している対象

  • シンプルなDIソリューションを探しているFlutter開発者
  • 大規模で保守可能なアプリケーションを開発するチーム
  • 堅牢なテスト戦略を必要とするプロジェクト
  • パフォーマンス向上のためコード生成を使用する開発者
  • 共有ロジックを持つ複数のプラットフォームをターゲットにするアプリ

注意事項

  • kiwi_generator を使用したコード生成には追加の設定が必要です
  • 小さなプロジェクトで過剰に使用するとオーバーヘッドが発生する可能性があります
  • DIパターンに馴染みのない開発者の学習曲線
  • 機能豊富なDIフレームワークと比べて、組み込み機能が限られている
  • 他の状態管理アプローチと併用するのが最適です

元の 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.

カテゴリー

依存関係

依存関係一覧 1 件

ソースリポジトリ

このパッケージを使用しているプロジェクト