isInExecutionContext property
if true, indicates that the current context is inside AsyncTask.run.
Implementation
bool get isInExecutionContext {
var executorThread = _executorThread;
return executorThread != null
? executorThread.isInExecutionContext(this)
: false;
}