Creating a Repository Interface
Once the Entities and Failures have been created, we can proceed with the creation of the Note Repository which defines the functionalities of the note feature without providing any implementation details.
All repository methods must abide by these rules :
A repository method must always return an Either monad A repository method always returns an Either object which can denote a
Left
orRight
value. If the method fails, then aFailure
object (Left Value) will be returned. If the method succeeds, then a null, primitive object, or anEntity
(Right Value) will be returned.A stream return type must be wrapped by a VerboseStream A VerboseStream is a stream wrapper (from the codenic_bloc_use_case package) which enables us to convert any exceptions into
Failure
objects.
In the note_app/modules/domain/lib/note/repository_interfaces/
directory, create the note_repository.dart
file:
Last updated