future_helper 0.0.1 copy "future_helper: ^0.0.1" to clipboard
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
110
points
36
downloads

Publisher

unverified uploader

Weekly Downloads

A package providing useful extensions and utitlity methods for Futures.

Documentation

API reference

License

MIT (license)

Dependencies

flutter

More

Packages that depend on future_helper