future_helper 0.0.1 icon indicating copy to clipboard operation
future_helper: ^0.0.1 copied to clipboard

A package providing useful extensions and utitlity methods for Futures.

Map a Future<InitialType> to a Future<TargetType>.

Usage #

final Future<int> intFuture = Future.value(3);
final Future<String> convertedFuture =
  intFuture.map((myInt) => 'My int converted $myInt');
final String convertedResult = await convertedFuture;

Useful for converting library futures to custom model futures:

final Future<CustomModel> customFuture =
  libraryFuture.map((libraryModel) => (CustomModel(libraryModel.property)));
final customModelResult = await customFuture;
1
likes
90
pub points
27%
popularity

Publisher

unverified uploader

A package providing useful extensions and utitlity methods for Futures.

Documentation

API reference

License

Icon for licenses.MIT (LICENSE)

Dependencies

flutter

More

Packages that depend on future_helper