Skip to content

fabrik_result

pub.dev

fabrik_result is a minimal and lightweight result-handling toolkit for real-world Dart and Flutter apps.


  • ✅ A sealed Either<L, R> type to model success/failure without using try-catch
  • 🎯 A Unit type to represent a typed void for functional-style APIs

fabrik_result is built for clarity, simplicity, and real usage in domain-driven apps.
It provides only what you need, making it extremely lightweight.


Terminal window
dart pub add fabrik_result

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(),
);

  • 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