Skip to content

Latest commit

 

History

History
44 lines (33 loc) · 1.67 KB

File metadata and controls

44 lines (33 loc) · 1.67 KB

1.0.0

Initial Release 🎉

Features

  • Type-safe Result Type: Introduced DataResult<S, F> sealed class for handling success and failure states
  • Pattern Matching: Added when method for exhaustive pattern matching
  • Optional Pattern Matching: Added whenOrNull method for handling only specific cases
  • Success/Failure Constructors: Simple constructors for creating results
  • Status Checking: isSuccess getter for quick status checks
  • Zero Dependencies: Pure Dart implementation with no external dependencies
  • Comprehensive Documentation: Full dartdoc comments for all APIs
  • Rich Examples: Multiple real-world usage examples included
  • Complete Test Coverage: Extensive unit tests covering all functionality

API

  • DataResult.success(S data) - Creates a successful result
  • DataResult.failure(F failure) - Creates a failed result
  • isSuccess - Returns true if result represents success
  • when({required success, required error}) - Pattern matching requiring both cases
  • whenOrNull({success, failure}) - Optional pattern matching

Documentation

  • Comprehensive README with multiple examples
  • Full API reference documentation
  • Real-world usage scenarios
  • Comparison with traditional error handling
  • Best practices guide

Examples

  • Basic success/failure handling
  • API call simulation
  • Form validation
  • Database operations
  • File operations
  • Pattern matching demonstrations

This is the first stable release of data_result. The package provides a robust, type-safe way to handle operations that can succeed or fail, inspired by Result types from functional programming languages.