Repository navigation
Releases
Releases · AndrewPiterov/fluent_result
v9.0.0
Breaking major. The core is now a Dart 3 sealed Result<T> — Ok<T> (non-null value) / Err<T> (single ResultError) — with compiler-enforced exhaustive switch and no more value!. The onException observability seam and mapper-free tryAsync are preserved.
Added
- Sealed
Ok/Errvariants; exhaustiveswitch; value-based, symmetric==/hashCode; immutable results. - Non-null
Ok.value; read via pattern matching /valueOrNull/valueOr/fold/match. ResultError.code/cause/stackTrace(the caught-exception path now lands the stack in theErr);runtimeTypein equality.Error-rethrow policy: an unmatched thrownErrorreaches the Zone / crash reporter; claim it with aResultMatcherto convert toErr.- Combinators:
map,flatMap,flatMapAsync, value-returningfold/match,valueOr,getOrElse,recover,mapError,Err.cast<R>.
Removed (breaking)
ResultOf<T>(→Result<T>),asResult, multi-error (errors/add/addAll/contains/get),ResultException, the deprecated 8.5exceptionHandler/exceptionHandlerMatchers/logSuccessResult, theResultConfig()factory, and thevoid fold({onFail,onSuccess})form.- The
collectiondependency — zero runtime dependencies. SDK floor>=3.0.0.
See the CHANGELOG and the README's 8.5 → 9.0 migration table.
v8.5.0
Additive, non-breaking minor. Adds a global observability seam for crash reporting, rounds out combinators, and removes two dependencies.
Added
ResultConfig.onException(no-op by default) — the single place to wire crash reporting (e.g. Sentry); unexpected caught exceptions are reported exactly once.ResultMatcher+ResultConfig.matchers— ordered, subtype-aware classification with anexpectedflag (expected control flow is never reported).ResultConfig.onSuccess,failBuilder,reset();onErrorWithStackontrySync/tryAsync.ResultOf.guard/guardAsyncand combinators:flatMap,flatMapAsync,match,valueOr,getOrElse,recover,mapError.
Changed
failIf/okIfroute throughfailBuilder— validation failures are never reported.fail/failWithreturnResultOf<T>(wasResultOf<T?>) — covariant, non-breaking.- SDK floor raised to
>=2.14.0. exceptionHandler,exceptionHandlerMatchers,logSuccessResultdeprecated (still functional).
Removed
loggerandquiverdependencies.
See CHANGELOG for migration notes.
v8.4.1
Patch release — pure bug fixes, no breaking changes, no new dependencies.
- [Fix]
Result.hashCodeis now stable and contract-correct, so equal Results share a hash code and work asSet/Mapkeys - [Fix]
ResultOf.map()no longer drops all but the first error when mapping a multi-error fail result - [Fix]
foldWithValue/mapthrow a clearStateErrorinstead of an opaqueTypeErrorwhen a non-nullable success value isnull - [Docs] corrected README
exceptionHandlerMatchersmatcher signature, nullableResultOf.value, andResult.failWithusage