widgets/use_memoized_future library

Classes

MemoizedAsyncSnapshot<T>
Stores an AsyncSnapshot as well as a reference to a function refresh that should re-call the future that was used to generate the snapshot.

Functions

useMemoizedFuture<T>(Future<T> future(), {List keys = const <dynamic>[], T? initialData, bool preserveState = true}) MemoizedAsyncSnapshot<T>
Subscribes to a Future and returns its current state in a MemoizedAsyncSnapshot. The future is memoized and will only be re-called if any of the keys change or if MemoizedAsyncSnapshot.refresh is called.