fresult 1.1.2
fresult: ^1.1.2 copied to clipboard
A Dart package providing Result types for better error handling with freezed.
Changelog #
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
[Unreleased] #
1.1.0 - 2025-09-08 #
1.0.0 - 2025-09-05 #
Added #
- Initial release of
fresult
package Result<T, E>
sealed class withSuccess
andFailure
variants- Comprehensive set of methods for working with Results:
map()
- Transform success valuesmapError()
- Transform failure errorsmapBoth()
- Transform both success and failureflatMap()
- Chain operations that return ResultsvalueOr()
- Get value with default fallbackvalueOrElse()
- Get value with computed fallbackvalueOrThrow()
- Get value or throw errorwhen()
- Pattern matching for success/failure
- Extensions for enhanced functionality:
onSuccess()
andonFailure()
for side effectsNullableToResult
extension for converting nullable valuesFutureResultExtensions
for working with async Results
- Comprehensive test suite with 100% coverage
- Example applications demonstrating various use cases
- Full documentation with API reference
- Linting configuration with strict rules
Features #
- Type-safe error handling without exceptions
- Immutable Result types using Freezed
- Functional programming patterns
- Async/await support
- Null safety support
- Comprehensive documentation and examples