interact method
void
interact({})
Marks an interaction and schedules delayed trigger.
noTriggering
If true
won't schedule trigger, only mark interaction.
interactionParameters
Stores parameters that can be used while triggering, using lastInteractionParameters.
Implementation
void interact(
{noTriggering = false,
List? interactionParameters,
bool ignoreConsecutiveEqualsParameters = false}) {
noTriggering ??= false;
if (interactionParameters != null) {
if (ignoreConsecutiveEqualsParameters) {
if (_lastInteractionParameters != null &&
isEqualsDeep(_lastInteractionParameters, interactionParameters)) {
log('ignore interact', [noTriggering, interactionParameters]);
return;
}
}
_lastInteractionParameters = interactionParameters;
}
log('interact', [noTriggering, interactionParameters]);
var now = this.now;
_lastInteractionTime = now;
_initInteractionTime ??= now;
_interactionNotTriggered = true;
if (!noTriggering) {
_scheduleTrigger(triggerDelayMs);
}
}