fabrik_result 0.1.1 copy "fabrik_result: ^0.1.1" to clipboard
fabrik_result: ^0.1.1 copied to clipboard

A lightweight toolkit for functional-style types like Either, built for clarity and real-world use.

fabrik_result #

A minimal and lightweight result-handling toolkit for real-world Dart and Flutter apps.

This package provides:

  • 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

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 #

dart pub add fabrik_result

Usage #

Either #

Either<Failure, User> result = await getUser();

result.fold(
  (failure) => handleError(failure),
  (user) => handleSuccess(user),
);

Unit #

Either<Failure, Unit> result = await save();

result.fold(
  (failure) => showError(failure),
  (_) => showSuccessToast(),
);

3
likes
160
points
21
downloads

Publisher

verified publisherfabriktool.com

Weekly Downloads

A lightweight toolkit for functional-style types like Either, built for clarity and real-world use.

Homepage
Repository (GitHub)

Documentation

API reference

License

MIT (license)

Dependencies

flutter

More

Packages that depend on fabrik_result