dime_flutter 0.5.0-nullsafety.1 copy "dime_flutter: ^0.5.0-nullsafety.1" to clipboard
dime_flutter: ^0.5.0-nullsafety.1 copied to clipboard

outdated

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:

Module Instance
ModuleA AA()
AB()
AC()
ModuleB BA()
BB()
BC()
ModuleC CA()
CB()
CC()
ModuleXX AA()
BB()
CC()

Scope graph:

Root Scope Modules/Scopes Modules/Scopes Modules/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

2
likes
0
pub points
0%
popularity

Publisher

unverified uploader

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

License

unknown (LICENSE)

Dependencies

dime, fimber, flutter

More

Packages that depend on dime_flutter