Composition root
app/providers.dart is the only file that constructs NoteRepositoryImpl.
clean-architectureflutter
lib/app/providers.dart imports the feature's data implementation and is the only place that constructs NoteRepositoryImpl. The notifier imports that file. The page imports the controller and the tile.
The shell imports the feature. A feature does not import a sibling feature. A type both need moves to shared/.
dart
final noteRepositoryProvider = Provider<NoteRepository>((ref) {
return NoteRepositoryImpl(ref.watch(noteStoreProvider));
});
final saveNoteUseCaseProvider = Provider<SaveNoteUseCase>((ref) {
return SaveNoteUseCase(
ref.watch(noteRepositoryProvider),
clock: ref.watch(clockProvider),
ids: ref.watch(idGeneratorProvider),
);
});The files are lib/app/providers.dart and lib/main.dart.
Next: Tests.