delayed_future 1.0.1 copy "delayed_future: ^1.0.1" to clipboard
delayed_future: ^1.0.1 copied to clipboard

retractedoutdated

A Dart extension that allows to delay your Futures.

delayed_future pub version #

⏳ A Dart extension that allows to delay your Futures.

Why? #

Sometimes it makes sense to delay your futures. For example, if you're making an API call and showing a loader. The response might come too quick fast.

By making sure that the execution will run for at least a little, like 350 ms, we'll make the loader more noticeable and the UX more convenient.

How to use #

Install the package #

Add the dependency to pubspec.yaml:

dependencies:
  delayed_future: ^1.0.0

Use it! #

// This will use default values from the config.
await anyFuture().delayed();

await anotherFuture().delayed(
    // Custom duration!
    duration: const Duration(milliseconds: 150),
);

Set the default values #

You can change the default value of duration like this:

DelayedFuture.duration = const Duration(milliseconds: 500);
2
likes
0
points
132
downloads

Publisher

unverified uploader

Weekly Downloads

A Dart extension that allows to delay your Futures.

Repository (GitHub)
View/report issues

License

unknown (license)

More

Packages that depend on delayed_future