FutureUtils<T> extension

Extensions on Future for real-world utility operations.

on

Methods

withFallback(T fallback) Future<T>

Available on Future<T>, provided by the FutureUtils extension

Returns fallback if this future throws any error.
withTimeout(Duration timeout, {T? fallback}) Future<T?>

Available on Future<T>, provided by the FutureUtils extension

Completes with fallback if this future does not resolve within timeout. Returns null as fallback if not specified.