run_once library
Support for doing something awesome.
More dartdocs go here.
Classes
- RunOnce
-
RunOnce uses StackTrace.current and carefully use this to keep record
on when a function has been called.
It means that the call stack is basically used as a unique identifier
for when and where a function has been called.
See the
_StackTracer
for the actual usage of StackTrace.current.
Functions
-
runOnce(
Function function, {Duration? forDuration}) → dynamic -
The
function
is the function to be called once. UsingforDuration
means for a duration runOnce can only run once. -
runOnceDestroy(
) → dynamic - Calling runOnceDestroy makes runOnce able to run once again. Note that this call is "scoped" based on the lexical scope where runOnceDestroy was called. The normal "use case" is to call runOnceDestroy somewhere in the same class that called runOnce.