Bug Fixes
Error.getOrThrow()now correctly passes<S, E>toSuccessResultNotFoundException, sotoString()shows the actual types instead ofdynamic.
New Features
Result.tryCatch(action, onError)— static factory that wraps a potentially-throwing synchronous computation.getOrElse(orElse)— returns the success value or a fallback computed from the error.onSuccess(action)/onError(action)— side-effect tap methods that execute an action without transforming the result, returningthisfor chaining.flatMapError(mapper)— symmetric counterpart toflatMapfor the error channel.recover(mapper)— alias forflatMapError.swap()— convertsSuccesstoErrorand vice versa.AsyncResult<S, E>— zero-costFuture<Result<S, E>>wrapper via Dart extension types, with a full mirrored API (mapSuccess,mapError,map,flatMap,flatMapAsync,flatMapError,swap,onSuccess,onError,getOrThrow,getOrElse,tryGetSuccess,tryGetError,when,isSuccess,isError, andtryCatch).AsyncResultOf<S, E>typedef alias forAsyncResult<S, E>.
Full Changelog: v5.2.0...v5.3.0