fresult 1.0.0 copy "fresult: ^1.0.0" to clipboard
fresult: ^1.0.0 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.0.0 - 2024-01-01 #

Added #

  • Initial release of freezed_result package
  • Result<T, E> sealed class with Success and Failure variants
  • Comprehensive set of methods for working with Results:
    • map() - Transform success values
    • mapError() - Transform failure errors
    • mapBoth() - Transform both success and failure
    • flatMap() - Chain operations that return Results
    • valueOr() - Get value with default fallback
    • valueOrElse() - Get value with computed fallback
    • valueOrThrow() - Get value or throw error
    • when() - Pattern matching for success/failure
  • Extensions for enhanced functionality:
    • onSuccess() and onFailure() for side effects
    • NullableToResult extension for converting nullable values
    • FutureResultExtensions 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
1
likes
0
points
39
downloads

Publisher

unverified uploader

Weekly Downloads

A Dart package providing Result types for better error handling with freezed.

Repository (GitHub)
View/report issues

Topics

#result #error-handling #freezed #functional-programming

License

unknown (license)

Dependencies

freezed_annotation

More

Packages that depend on fresult