resultex 4.0.2
resultex: ^4.0.2 copied to clipboard
A robust core architecture ecosystem for Flutter and Dart, providing unified dependency injection and error management utilities.
Changelog #
All notable changes to the error_handler package will be documented in this file. This project
adheres to Semantic Versioning.
4.0.2 - 2026-07-31 #
- Refactor and Fixed refactored and added logger initializer to resultex init func
4.0.1 - 2026-07-30 #
- Refactor: Complete code optimization and structural cleanup across the core logic.
- Documentation: Updated and polished
README.mdto reflect version 4.0 updates.
4.0.0 - 2026-07-29 #
Breaking Changes #
- Observer System Redesign: Removed the restricted static
ResultexObserver.initializemethod and introduced a new Broadcast architecture viaResultexObserverManager.addObserver()to allow simultaneous registration of multiple observers (e.g., Sentry, Firebase).
Architecture & Directory Restructuring #
- Extensions Folder Restructuring: Reorganized and categorized extension files into dedicated
domain-specific subdirectories (
async,collections,integrations, andtransform). - Naming Convention Standardization: Standardized all extension file names with the consistent
_extension.dartsuffix. - Centralized Barrel File: Created a comprehensive
extensions.dartfile to manage all exports centrally and keep the main package file (resultex.dart) clean from scattered imports.
Refactored & Fluent APIs #
- Converted
ResultUtils.combineAllto Extension: Migrated the aggregation logic toResultIterableExtensiononIterable<Future<Result<T>>>and completely removed the obsoleteResultUtilsclass. - Converted
ResultCollectiontomapResultExtension: Migrated list-mapping logic (supporting both Strict and Lenient strategies) into a fluent.mapResult()extension method onIterable<I>and removed the old class.
Widget Enhancements & Animations #
- Animated
ResultSwitch: UpgradedResultSwitchto support smooth, fluid state transitions with built-in animations (AnimatedResultSwitch). - Dedicated Configuration Support: Introduced a dedicated configuration file/class for
ResultBuilderandResultSwitchto cleanly manage properties, transition settings, and UI behaviors. - Refactored UI Components: Enhanced performance, clean code architecture, and API ergonomics
for both
ResultBuilderandResultSwitch.
Enhancements & Safety #
ResultMemoizerSafety Optimization: Preserved the class-based structure (required for state and cache persistence) and added a robusttry-finallysafety net to prevent gateway deadlocks on unexpected exceptions.- Pub.dev Analyzer Compliance: Refactored platform error dispatching to utilize
WidgetsBinding.instanceinstead of directdart:uiimports, ensuring 100% clean analyzer reports and pure package compliance.
3.2.0 - 2026-07-27 #
New Features #
- Global Telemetry & Crash Reporting: Introduced
ResultexObserver, a globally accessible, thread-safe observer for tracking state changes and failures. Easily integrate with tools like Firebase Crashlytics, Sentry, or Datadog without polluting your UI or business logic. - Auto-Dispatch Failures:
FailureResultnow automatically notifies the globalResultexObserverupon instantiation, ensuring no unhandled error goes unlogged.
Improvements & Refactors #
- Centralized State Tracking: Refactored
ResultNotifierby overriding thevaluesetter. This ensures all state transitions (reset,emitSuccess,track,refresh) are automatically dispatched to theResultexObservervia a single, DRY entry point. - Barrel File Updates: Exported the newly added
ResultexObserverand Network Failures in the mainresultex.dartlibrary file for public access.
Testing #
- Added comprehensive unit tests for
ResultexObserverto ensure proper delegate registration, state resetting between tests, and safe exception swallowing (preventing third-party logger crashes from impacting the main app thread).
3.1.0 #
Added #
ResultListener: Added a dedicated widget for non-rebuilding side-effects (e.g., SnackBars, Dialogs, Navigation).ResultConsumer: Added a combined widget merging UI building and side-effect execution in a single component.MultiResultBuilder: Added a reactive widget to observe multipleResultNotifierinstances simultaneously without creating nested builder trees.- Stale-While-Revalidate (SWR) Support: Added
isRefreshingproperty andrefresh()method toResultNotifierfor background data revalidation while retaining stale UI data. - Rate-Limiting Extensions (
debounce&throttle): Added functional programming extensions onResultNotifierto control action execution frequency for inputs and button taps. - Auto-Retry Extensions (
retryWithBackoff&executeWithRetry): Added exponential backoff auto-retry capabilities for asynchronous operations andResultNotifier.
Changed #
- Package Architecture: Restructured internal directories to strictly follow Dart package
guidelines (enforced encapsulation by moving core modules inside
src/).
Documentation #
- Updated
README.mdwith comprehensive usage examples for new reactive UI components, SWR pattern, and functional extensions.
3.0.3 - 2026-07-20 #
Improved #
- Performance: Refactored
ResultBuilderto aStatefulWidgetto reduce widget tree depth and optimize reactive UI updates. - Syntax: Enhanced
ResultSwitchto utilize Dart 3 exhaustive pattern matching for unified null/state evaluations. - Architecture: Converted
Resultexcoordinator into a static namespace and modernized the main library export structure. - Documentation: Added comprehensive DartDoc comments across core widgets and utilities.
3.0.2 - 2026-07-20 #
- Documentation: Updated README.md with package table and improved installation guides.
3.0.1 - 2026-07-20 #
- Documentation: Initial updates to README.md and usage guide improvements.
3.0.0 - 2026-07-18 #
Breaking Changes #
- Refactored
ResultExecutorandFlutterErrorHandlerto use Constructor Injection. The implicit dependency onGetIthas been completely removed.
Refactoring & Improvements #
- State Management: Hardened
ResultNotifierwith execution tokens to prevent race conditions and added dispose-safety checks. - UI Builders: Optimized
ResultBuilderandResultSwitchfor better performance and stricter separation of concerns. Exchanged manual checks for Dart 3 exhaustive pattern matching. - Form Controls: Improved
ResultTextControllerperformance by caching validation results. - Testing: Replaced custom
Matcherclasses with Dart's nativeisA<T>().having()for greater test stability and prevention of unhandled exceptions.
2.7.0 - 2026-07-16 #
Added #
- Public API Exposure: Exported core domain models (
Failure,Success) directly from the main library entry point (lib/resultex.dart). This enables clean integration with external sub-packages (likeresultex_network) and third-party extensions without referencing internalsrc/files. - New
ResultSwitchWidget: Added a declarative, elegant UI component that allows developers to pattern-match and switch between differentResultstates directly in the widget tree, keeping presentation code clean and readable.
Changed #
- Refactored
ResultBuilder: Thoroughly polished and optimized the state-rebuilding pipeline inResultBuilderto offer smoother UI updates, stronger type safety, and better integration with asynchronous states.
2.6.1 - 2026-07-13 #
🚀 Added #
- Custom Test Matchers: Introduced
isSuccess,isFailure, andisFailureTypeinsidelib/resultex_test.dartfor clean, expressive, and robust unit testing ofResulttypes.
Fixed #
- Resolved minor internal bugs to improve core package stability and pipeline performance.
- Adjusted
flutter_testdependency allocation to correctly support library-level custom matchers.
2.6.0 - 2026-07-11 #
Enterprise Concurrency & Lifecycle #
- Added
CancellableResultandCancellationFailure: Prevent memory leaks andsetStateafter dispose errors in Flutter by instantly aborting pending asynchronous operations when a view is disposed. - Added
Result.race: Race multiple asynchronousResultoperations. Resolves with the firstSuccessResultor anAccumulatedFailureif all operations fail, perfect for redundant network requests. - Added
Result.memoizeAsync: Optimize performance by caching functional evaluations. Prevents duplicate network/computation calls for concurrent requests in the UI.
Advanced Error Management #
- Added
ResultexObserver: A globally accessible, thread-safe observer for centralized error logging and crash reporting (e.g., Firebase Crashlytics, Sentry) without polluting business logic. - Added
Result.accumulate: Parallel validation flow support. Validate a collection of results simultaneously and catch all errors at once via the newAccumulatedFailureclass (ideal for complex form validations). - Added Monadic Recovery (
.recover&.recoverAsync): Gracefully patch pipeline failures by routing operational infractions through a fallback provider (e.g., falling back to a local database when a network request fails).
State Management Integration #
- Added
toBlocStateExtension: Seamlessly bridge asynchronous core architecture outcomes with Flutter state emitters (BLoC/Cubit). Automatically unpacks monad containers and dispatches execution blocks straight to state emission streams.
Refactoring & Internal Improvements #
- Enhanced asynchronous generic type matching and pipeline safety across all extension methods.
- Maintained 100% backward compatibility with
v2.5.0core APIs.
2.5.0 #
🚀 New Features #
- ResultTextController (Flutter): Introduced an advanced reactive text field validator
controller enabling direct mapping of native UI form inputs into declarative, type-safe
Resultoutputs. - VoidResult & Functional Unit: Introduced the semantic
Unitobject (built on top of a strictfinal classcontract) andVoidResulttype alias to elegantly model actions that finish successfully without returning data, eliminatingResult<void>ornullbypasses. - Conditional Interception (.ensure): Added the
.ensure()filtering pipeline to conditionally validate wrapped data; failing the predicate dynamically reroutes the execution into aFailureResult. - Reactive Stream Safety: Implemented
ResultStreamXfeaturing.toResultStream()to map native asynchronous Dart Streams safely into predictable, crash-proofStream<Result<T>>pipelines. - Passive Inspect Telemetry: Added
.inspectSuccess()and.inspectFailure()monadic side-effect pipelines to intercept data streams for logging/analytics without modifying the internal payload state. - Dart 3 Records Zipping: Redesigned the type-safe zipping architecture to natively leverage
Dart 3 Records (
(Result1, Result2).zip(...)) supporting up to 5 heterogeneous elements with exhaustive pattern matching. - FutureResultX Extension: Introduced the highly requested
.toResult()extension on raw asynchronous primitive futures, enabling instant inline conversion from third-party APIs into cleanResultwrappers. - ResultExecutor Optimization: Enhanced
executeAsyncto handle asynchronous flat-mapping lifecycles seamlessly, preventing annoying nestedResult<Result<T>>structures.
2.4.0 #
🚀 New Features #
- Dart 3 Records Zipping: Redesigned the type-safe zipping architecture to natively leverage
Dart 3 Records (
(Result1, Result2).zip(...)) supporting up to 5 heterogeneous elements with exhaustive pattern matching. - FutureResultX Extension: Introduced the highly requested
.toResult()extension on raw asynchronous primitive futures, enabling instant inline conversion from third-party APIs into cleanResultwrappers. - ResultTransformationX Extension: Added monadic transformation and side-effect mapping extensions to easily manipulate encapsulated data down the functional stream.
- ResultExecutor Optimization: Enhanced
executeAsyncto handle asynchronous flat-mapping lifecycles seamlessly, preventing annoying nestedResult<Result<T>>structures.
2.3.1 #
- Updated README.md and scripts
2.3.0 #
🚀 Added #
- Advanced Async Functional Chaining: Introduced
asyncMapandasyncFlatMapextensions onFuture<Result<S>>to seamlessly chain asynchronous operations without nestedawaitblocks. - Reactive UI State Management (
ResultNotifier): Added a lightweight, lifecycle-aware state manager extending Flutter'sValueNotifierto track operational statuses natively. - Declarative Layout Builder (
ResultBuilder): Added a tailored UI builder widget that exhaustively pattern-matchesResultNotifierstates intoonLoading,onSuccess, andonFailurewidget trees. - Resilient Recovery Pipelines: Added advanced
mapFailureandasyncMapFailureextensions to mutate and adapt failure contracts down the stream. - Transient Network/Operation Retries: Added a flexible
withRetrymechanism onFutureclosures supporting custom attempt limits and backoff strategies.
⚡ Changed #
- Fully optimized all internal UI routing mechanics to exploit Dart 3+ exhaustive switch expressions for rigid compile-time safety.
2.2.0 - 2026-07-02 #
Added #
- Flutter UI Extension (
.when()): Added a highly readable, Dart 3 pattern-matching-backed extension method onResultto cleanly map success and failure states directly into Flutter widgets without conditions. - Parallel Execution Utility (
ResultUtils.combineAll): Introduced a concurrent utility method to fire multipleFuture<Result>operations simultaneously. - Composite Error Framework (
MultiFailure): Added a new failure variant that aggregates all intercepted errors from parallel dispatches instead of short-circuiting on the first failure.
Changed #
- License Alignment: Fully migrated and aligned the project license framework to MIT across all documentation and registry metadata for seamless commercial and open-source adoption.
- Documentation Updates: Rewrote the
README.mdto include interactive layout design recipes, concurrent API usage guides, and modern Dart 3 structural pattern examples.
Fixed #
- Pattern Matching Type Inference: Resolved internal compiler mismatches during تو در تو (
nested) destructuring of the
Success<T>wrapper inside concreteSuccessResultscopes.
2.1.0 #
- Feat: Introduced
ResultExtensionson theResult<T>sealed hierarchy. - Feat: Added
.recover()mechanism to gracefully intercept operational failures and route them through alternative backup execution pipelines. - Feat: Added
.getOrElseAsync()supporting polymorphic (FutureOr<T>) flows to safely unpack success states or execute asynchronous fallback strategies (e.g., local cache recovery). - Docs: Fully documented extension methods with clean code architecture examples in README.
2.0.1 #
- Internal restructuring and code migrations.
- Integrated
resultex_loggerpackage as a core module dependency. - Fixed dartdoc references and static analysis warnings.
2.0.0 #
Breaking Changes #
- Migrated core modules and decoupled dependency injection from localized constructors.
- Integrated
resultex_loggeras a core dependency.
1.0.4 - 2026-06-30 #
- Hard clean and complete removal of unused dependencies for full WASM/Web compatibility.
1.0.3 - 2026-06-30 #
- Removed external logger dependency to achieve full Web and WASM compatibility.
1.0.2 - 2026-06-30 #
- Switched to MIT license for better pub.dev recognition.
- Upgraded dependencies including get_it to support version 9.2.1.
1.0.1 - 2026-06-30 #
- Updated Flutter environment constraints.
- Added documentation example.
- Fixed pub points analysis.
1.0.0 - 2026-06-29 #
Added #
- Core Result Pattern: Introduced
Result<S, F>,SuccessResult, andFailureResultusing Dart 3 sealed classes for compile-time safe pattern matching. - Functional Operators: Added fluent API chaining methods including
map,flatMap,fold,getOrElse, andfromNullable. - Safe Execution Guards: Implemented
Result.guard()andResult.guardAsync()to seamlessly intercept and encapsulate imperative exceptions. - Batch Operations: Added
Result.combine()andResult.partition()for combining or separating multiple asynchronous operations. - ResultExecutor Layer: Created a dedicated execution engine with built-in context tracking and automated error logging.
- Global Error Hooks: Added
FlutterErrorHandlerto handle framework-level crashes and integrate with external crash reporters (e.g., Firebase).
Security & License #
- Distributed under the GPL v3.0 License for open-source copyleft protection.
- Secure key and context tracking adhering to strict memory and performance safety.
0.0.1 - 2026-06-25 #
- Initial project structure setup and architecture design brainstorming.