clean_signals library
A lightweight use-case and controller framework for signals-based Flutter and Dart applications.
- Result / Success / Failed — typed operation outcomes
- Failure — sealed-hierarchy-friendly domain failures
- UseCase / StreamUseCase — guarded business-logic units
- Controller — signals-based view-model base with activity tracking, failure routing, retries and lifecycle cleanup
- ActivityTracker — ref-counted loading state
- RetryPolicy — per-call declarative retries
Classes
- ActivityTracker
- Ref-counted activity (loading) tracking backed by signals.
- CleanSignalsLogger
- Process-wide logger shared by clean_signals classes.
- Controller
- Base class for presentation-layer controllers (view models).
-
Failed<
T> - NoParams
- Parameter type for use cases that take no input.
-
Result<
T> - The outcome of an operation: either Success with a value or Failed with a Failure.
- RetryPolicy
- Declarative retry behaviour for a single use-case invocation.
-
StreamUseCase<
P, R> - A unit of business logic producing a stream of Results.
-
Success<
T> -
UseCase<
P, R> - A single unit of business logic producing one Result.
Functions
-
asyncStateSignal<
T> () → Signal< AsyncState< T> > -
Creates a
Signal<AsyncState<T>>seeded withAsyncLoading.
Exceptions / Errors
- Failure
- Base class for domain failures.
- UnexpectedFailure
- A failure produced from an error that no domain failure accounts for.