clean_result library

A lightweight Dart utility for result-based business logic.

This library provides Result, Success, and Failure types to model business outcomes without relying on exceptions.

It is framework-agnostic and designed to support clean architecture.

Classes

ApiExecutor
Executes an asynchronous operation safely and wraps the result in a Result without throwing exceptions to the caller.
Failure<T>
Represents a failed result containing an error message.
Result<T>
Represents the result of a business operation.
Success<T>
Represents a successful result containing data.

Extensions

ResultMapper on Result<T>
Extension utilities for transforming and handling Result values.

Exceptions / Errors

BusinessException
Exception representing a business-level failure.