presentation/helpers/loading_wrapper library

Functions

callWithLoadingAfterTimeout<T>(Future<T> fn(), {void onError(dynamic error)?, int? timeoutBeforeLoadingMill, LoadingStartCallback? onLoadingStart, LoadingFinishCallback? onLoadingFinish}) Future<T>
Calls the given function and shows a loading overlay after a timeout. The loading overlay is shown only if the function call takes longer than the given timeout. The T type is the return type of the function.
configureTimeoutLoadingCallbacks({LoadingStartCallback? onLoadingStart, LoadingFinishCallback? onLoadingFinish}) → void
getActiveLoadingCallsCount() int
Get current active loading calls count - useful for debugging
resetLoadingState() → void
Reset the loading state - useful for error recovery

Typedefs

LoadingFinishCallback = void Function()
LoadingStartCallback = void Function()