railway_chopper 0.2.1 copy "railway_chopper: ^0.2.1" to clipboard
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 mapResponse as a deprecated function to provide backward compatibility for v0.1.0 consumers. It will be removed in v0.3.0.

0.2.0 #

Breaking #

  • mapResponse removed. Replaced by toEither, an extension on Future<Response<T>> — call sites change from mapResponse(() => myApi.getSomething()) to myApi.getSomething().toEither().

Added #

  • Web platform support — response_mapper.dart no longer imports dart:io; catches http.ClientException instead of SocketException (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 NetworkFailure variant table.
  • Added a style: lints badge.

0.1.0 #

Initial release.

  • buildChopperClient — pre-configured Chopper client factory, accepts http.Client?, Converter?, ErrorConverter?, and default headers
  • NetworkFailure — sealed, freezed union covering network, timeout, server, clientError, unauthorized, unknown
  • mapResponse — wraps a Chopper request and returns Either<NetworkFailure, T>
5
likes
160
points
236
downloads

Documentation

API reference

Publisher

verified publisherstucknot.com

Weekly Downloads

A chopper client factory and a Response -> Either<NetworkFailure, T> mapper for railway-oriented error handling in Flutter/Dart.

Repository (GitHub)
View/report issues

Topics

#network #http #chopper #either #error-handling

License

MIT (license)

Dependencies

chopper, fpdart, freezed_annotation, http

More

Packages that depend on railway_chopper