Skip to content

Releases

v9.0.0

Choose a tag to compare

@AndrewPiterov AndrewPiterov released this 28 Jun 11:43
1c1ced5

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/Err variants; exhaustive switch; 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 the Err); runtimeType in equality.
  • Error-rethrow policy: an unmatched thrown Error reaches the Zone / crash reporter; claim it with a ResultMatcher to convert to Err.
  • Combinators: map, flatMap, flatMapAsync, value-returning fold / 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.5 exceptionHandler/exceptionHandlerMatchers/logSuccessResult, the ResultConfig() factory, and the void fold({onFail,onSuccess}) form.
  • The collection dependency — zero runtime dependencies. SDK floor >=3.0.0.

See the CHANGELOG and the README's 8.5 → 9.0 migration table.

v8.5.0

Choose a tag to compare

@AndrewPiterov AndrewPiterov released this 28 Jun 05:41
9940d0f

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 an expected flag (expected control flow is never reported).
  • ResultConfig.onSuccess, failBuilder, reset(); onErrorWithStack on trySync/tryAsync.
  • ResultOf.guard/guardAsync and combinators: flatMap, flatMapAsync, match, valueOr, getOrElse, recover, mapError.

Changed

  • failIf/okIf route through failBuilder — validation failures are never reported.
  • fail/failWith return ResultOf<T> (was ResultOf<T?>) — covariant, non-breaking.
  • SDK floor raised to >=2.14.0.
  • exceptionHandler, exceptionHandlerMatchers, logSuccessResult deprecated (still functional).

Removed

  • logger and quiver dependencies.

See CHANGELOG for migration notes.

v8.4.1

Choose a tag to compare

@AndrewPiterov AndrewPiterov released this 27 Jun 15:25

Patch release — pure bug fixes, no breaking changes, no new dependencies.

  • [Fix] Result.hashCode is now stable and contract-correct, so equal Results share a hash code and work as Set/Map keys
  • [Fix] ResultOf.map() no longer drops all but the first error when mapping a multi-error fail result
  • [Fix] foldWithValue/map throw a clear StateError instead of an opaque TypeError when a non-nullable success value is null
  • [Docs] corrected README exceptionHandlerMatchers matcher signature, nullable ResultOf.value, and Result.failWith usage

📦 https://pub.dev/packages/fluent_result/versions/8.4.1

v8.4.0

Choose a tag to compare

@AndrewPiterov AndrewPiterov released this 21 Oct 11:18

[8.4.0]

  • [Fix] can pass null in successWith(null)

Full Changelog: v8.3.0...v8.4.0