ExecutionModifier enum

Defines the execution modifier for actions.

Execution modifiers control how frequently an action can be executed, providing mechanisms to prevent excessive or rapid-fire executions.

Inheritance
Available extensions

Values

throttle → const ExecutionModifier

Throttles action execution to a maximum frequency.

When using throttle, the action will be executed at most once per specified duration. If the action is called multiple times within the duration window, only the first call will be executed, and subsequent calls will be ignored until the duration expires.

Example:

ExecutionOptions(
  modifier: ExecutionModifier.throttle,
  duration: Duration(milliseconds: 500),
)

This will ensure the action executes at most once every 500ms.

debounce → const ExecutionModifier

Debounces action execution by delaying execution until after a quiet period.

When using debounce, the action execution is delayed until the specified duration has passed without any new calls. If the action is called again before the duration expires, the timer resets. This is useful for actions that should only execute after the user has stopped performing the triggering action for a certain period.

Example:

ExecutionOptions(
  modifier: ExecutionModifier.debounce,
  duration: Duration(milliseconds: 300),
)

This will execute the action only after 300ms of inactivity.

Properties

hashCode int
The hash code for this object.
no setterinherited
index int
A numeric identifier for the enumerated value.
no setterinherited
name String

Available on Enum, provided by the EnumName extension

The name of the enum value.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Constants

values → const List<ExecutionModifier>
A constant List of the values in this enum, in order of their declaration.