Skip to content

Commit

Permalink
Merge pull request #316 from woltapp/coffee-maker-add-di-diagram-to-main
Browse files Browse the repository at this point in the history
[Coffee Maker Demo app] Added dependency injection explanation in code diagram to main.dart
  • Loading branch information
ulusoyca authored Aug 29, 2024
2 parents 90cf214 + 28d0579 commit 961072b
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions coffee_maker_navigator_2/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,45 @@ void _registerDependencyContainerFactories(DependencyContainerManager manager) {
() => LoginScreenDependencyContainer());
}

/*
+----------------------------------+
| DependencyContainerManager | +----------------------------------+
| +-----------------------------+ | | |
| | App Level DI Container | | | MaterialApp |
| | +-------------------------+ | | | +-----------------------------+ |
| | | AuthService | | | | | DependencyInjector | |
| | +-------------------------+ | | | | Widget | |
| | | AuthRepository | | | | | +-----------------------+ | |
| | +-------------------------+ | | | | | FeatureLevelDependency| | |
| | | AuthRemoteDataSource | | | | | | Container | | |
| | +-------------------------+ | | | | | +-------------------+ | | |
| | | RouterViewModel | | | | | | | Feature | | | |
| | +-------------------------+ | | | | | | Screen Widget | | | |
| +-----------------------------+ | | | | | | | | |
| | | | | +-------------------+ | | |
| +-----------------------------+ | | | | | | |
| | OrdersDependencyContainer | | | | +-----------------------+ | |
| | +-------------------------+ | | | +-----------------------------+ |
| | | OrderService | | | | |
| | +-------------------------+ | | +----------------------------------+
| | | OrdersRepository | | |
| | +-------------------------+ | |
| | | OrdersRemoteDataSource | | |
| | +-------------------------+ | |
| | | OrderScreenVM (Factory) | | |
| | +-------------------------+ | |
| +-----------------------------+ |
| |
| +-----------------------------+ |
| | AddWaterDependencyContainer | |
| | +-------------------------+ | |
| | |AddWaterScreenVM(Factory)| | |
| | +-------------------------+ | |
| | | AddWaterService | | |
| | +-------------------------+ | |
| +-----------------------------+ |
+----------------------------------+
*/
Future<void> main() async {
WidgetsFlutterBinding.ensureInitialized();
final dependencyContainerManager = DependencyContainerManager.instance;
Expand Down

0 comments on commit 961072b

Please sign in to comment.