railway_chopper 0.2.1
railway_chopper: ^0.2.1 copied to clipboard
A chopper client factory and a Response -> Either<NetworkFailure, T> mapper for railway-oriented error handling in Flutter/Dart.
Changelog #
0.2.1 #
Fixed / Compatibility #
- Restored
mapResponseas a deprecated function to provide backward compatibility forv0.1.0consumers. It will be removed inv0.3.0.
0.2.0 #
Breaking #
mapResponseremoved. Replaced bytoEither, an extension onFuture<Response<T>>— call sites change frommapResponse(() => myApi.getSomething())tomyApi.getSomething().toEither().
Added #
- Web platform support —
response_mapper.dartno longer importsdart:io; catcheshttp.ClientExceptioninstead ofSocketException(covers both native and web transports). - Test cases for better coverage
Changed #
- README expanded with a "Why railway_chopper over plain chopper?" comparison and a full
NetworkFailurevariant table. - Added a
style: lintsbadge.
0.1.0 #
Initial release.
buildChopperClient— pre-configured Chopper client factory, acceptshttp.Client?,Converter?,ErrorConverter?, and default headersNetworkFailure— sealed, freezed union coveringnetwork,timeout,server,clientError,unauthorized,unknownmapResponse— wraps a Chopper request and returnsEither<NetworkFailure, T>