Documentation IndexFetch the complete documentation index at: /llms.txtUse this file to discover all available pages before exploring further.
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
🚀 Flutter_Extend Version 0.3.0 is now live! See our changelog for details.
Essential utilities for mastering asynchronous code: implement automatic retries, set fallbacks for timeouts, and manage execution delays.
Show Parameters
duration
Future
// Retries the network call up to 3 times final data = await fetchUserData().retry(3, delay: 1.seconds);
fallbackValue
// Returns 0 if the computation takes longer than 5 seconds. final result = await complexCalculation() .timeoutWithFallback(Duration(seconds: 5), 0);
delay
// Simulate a slow network with a 2-second minimum delay. final data = await fetchSettings().runAfterDelay(Duration(seconds: 2));
final myFuture = Future.delayed(Duration(seconds: 2), () => 42); print(myFuture.isComplete()); // false (initially)
Completer
final completer = someFuture.wrapInCompleter();
Was this page helpful?