dime_flutter 0.4.0

Flutter Android iOS web

Flutter support for Dime dependency injection. Will provide scoped widgets and helping methods to use Dime with in Flutter codebase.

Dime Flutter package #

Bringing Dime dependency injection to Flutter with usable helper methods and Widgets.

Getting Started #

Take a look at Dime package for BaseModules and definitions.

Use DimeScopeFlutter to wrap child widget with Dime Scope and provide list of modules for that scope. Root Scope modules are always fallback to. Use DimeFlutter.scopeOf(...) as inherit widget to fetch DimeScope to get instances you need down the tree.

Dime Scope fetch up the tree examples: #

Test class to be referenced by main scope_test.dart tests.

Modules:

ModuleInstance
ModuleAAA()
AB()
AC()
ModuleBBA()
BB()
BC()
ModuleCCA()
CB()
CC()
ModuleXXAA()
BB()
CC()

Scope graph:

Root ScopeModules/ScopesModules/ScopesModules/Scopes
Dime- ModuleC
- ModuleXX (override)
- scope1- ModuleA
- ModuleB
- scope2- ModuleA
- ModuleC
- scope 21- ModuleC
- scope 22- ModuleA
- ModuleB

Example injections:

scope2.inject<CA> - from scope2.ModuleC.CA

Dime.inject<CA> - from dime.ModuleC.CA

scope1.inject<CA> - from dime.ModuleC.CA

scope1.inject<AA> - from scope1.ModuleA.AA

scope2.inject<BC> - not found - can't access other scopes

scope2.inject<AB> - from scope2.ModuleA.AB

Dime.inject<AA> - dime.ModuleXX.AA

Dime.inject<AB> - not found - Dime can't drill to scopes

Dime.inject<CC> - dime.ModuleC.CC

scope21.inject<AA> - scope2.ModuleA.AA

scope21.inject<CC> - scope21.ModuleC.CC

scope22.inject<AC> - scope22.ModuleA.AC

scope22.inject<CB> - scope2.ModuleC.CB

scope21.inject<BB> - dime.ModuleX.BB

0
likes
90
pub points
59%
popularity

Flutter support for Dime dependency injection. Will provide scoped widgets and helping methods to use Dime with in Flutter codebase.

Repository (GitHub)
View/report issues

Documentation

API reference

Uploader

mati.akip@gmail.com

License

Apache 2.0 (LICENSE)

Dependencies

dime, fimber, flutter

More

Packages that depend on dime_flutter