Software EngineeringOpen accessPublished 3 Oct 2026
Defines the contract between a Bloc and the data layer: every Repository method returns `Future<Result<T>>`, never throws. The `Result<T>` union carries either the successful `T` or a `Failure` — `Failure` is fixed (not a second generic parameter on `Result`), so the union is parameterised by the success type alone. The Bloc handler emits `Loading`, awaits the repository, and emits `Loaded` or `Failure` by pattern-matching on the `Result`. Failure shapes mirror Laravel's HTTP response taxonomy (especially the 422 validation envelope), so backend errors round-trip cleanly into the UI. Builds on `flutter-bloc-feature-pattern`; the HTTP transport itself is covered by `flutte…