future_widget library

Library providing FutureWidget and FutureWidgetWrapper.

Classes

AbstractFutureGen<T>
Extended by FutureGen and FutureGenWithInitialData.
FutureGen<T>
Without initial data.
FutureGenWithInitialData<T>
initialDataGen is a function so that it can be created lazily, if isLazy is true. It will be evaluated immediately otherwise.
FutureWidget<T>
A Widget that builds depending on the state of one or more Futures.
FutureWidgetWrapper<T>
The futureContext from the unsafeOnlyDataBuilder is supposed to be passed to the FutureWidget defined inside unsafeOnlyDataBuilder's body.
RefreshType
  • nonPriorityDebounced:

    • This option only allows refreshing one future at a time — with the precondition being there is no refresh already happening.
    • All future nonPriorityDebounced and nonPriorityUnfiltered refresh requests are discarded as long as the current one has not completed.
    • "Debounced" indicates the process of filtering out noise.
  • nonPriorityUnfiltered:

    • This option only allows refreshing one future at a time — with the precondition being there is no refresh already happening.
    • All future nonPriorityDebounced and nonPriorityUnfiltered refresh requests are discarded as long as the current one has not completed.
    • Unlike nonPriorityDebounced, if one of priorityDebounced or priorityUnfiltered are called while the future is in progress, the FutureWidget will display the value for a short amount of time, before being replaced by the value/exception emitted by later invoked, completed future. "Unfiltered" indicates the absence of such a filtering process.
  • priorityDebounced:

    • It has higher priority than non-priority refreshes.
    • This option allows multiple refreshes, but debounces the refreshes to prevent rebuilds in quick succession.
  • priorityUnfiltered:

    • It has higher priority than non-priority refreshes.
    • This option allows immediate rebuilds in quick succession: it doesn't debounce the refreshes; instead, it triggers a rebuild immediately after a refresh is requested.
  • Exceptions / Errors

    FutureWidgetUnexpectedError
    Error that is thrown when the future inside a FutureWidget throws an error.