fabrik_result
fabrik_result
is a minimal and lightweight result-handling toolkit for real-world Dart and Flutter apps.
Features
Section titled “Features”- ✅ A sealed
Either<L, R>
type to model success/failure without using try-catch - 🎯 A
Unit
type to represent a typedvoid
for functional-style APIs
Philosophy
Section titled “Philosophy”fabrik_result
is built for clarity, simplicity, and real usage in domain-driven apps.
It provides only what you need, making it extremely lightweight.
Installation
Section titled “Installation”dart pub add fabrik_result
Either
Section titled “Either”Use Either<Failure, Success>
to safely model operations that may fail:
Either<Failure, User> result = await getUser();
result.fold( (failure) => handleError(failure), (user) => handleSuccess(user),);
Use Unit
when the success case doesn’t need to return data:
Either<Failure, Unit> result = await save();
result.fold( (failure) => showError(failure), (_) => showSuccessToast(),);
Summary
Section titled “Summary”- Lightweight alternative to
dartz
and other functional packages - Built for simplicity and real-world Flutter/Dart apps
- Great for clean architecture and domain-driven design