Presentation
A Riverpod notifier calls the use case. The note tile does not import Riverpod. Beamer reports the screen.
features/notes/presentation/ holds the page, the notifier, and the tile. The tile does not import Riverpod. The notifier imports app/providers.dart for the use cases. Neither the page nor the notifier imports features/notes/data/.
The shell router is app/router/notes_location.dart. It imports the feature page. ScreenReporter calls NotesMonitoring.setScreen from that location, so Beamer stays the router adapter even though the route table is not inside the feature.
Future<String?> save(String title, String body) async {
try {
await ref.read(saveNoteUseCaseProvider).execute(title: title, body: body);
final notes = await ref.read(listNotesUseCaseProvider).execute();
state = AsyncData(notes);
return null;
} on ValidationFailure catch (error) {
return error.message;
}
}null means the list state was replaced and the page clears the fields. A string means the form shows that message and the list stays as it was. A blank title never reaches the store.
lib/features/notes/presentation/notes_page.dartwatches the provider and draws the formlib/features/notes/presentation/notes_controller.dartcalls the use cases throughapp/providers.dartlib/features/notes/presentation/note_tile.darttakes a title and a bodylib/app/router/notes_location.dartlives outside the feature and reports the screen
Next: Composition root.