TappableActionConfig class

Configuration for TappableAction behavior

Annotations

Constructors

TappableActionConfig({bool requireNetwork = true, bool debounceTaps = true, Duration? coolDownDuration, Duration? delayBeforeFirstTapDuration, bool disableVisuallyDuringFirstDelay = true, Duration? minDisabledDuration, String? groupId, bool disableVisuallyDuringDebouncing = true, TapExecutionMode executionMode = TapExecutionMode.throttle, bool executeOnLeadingEdge = true, bool executeOnTrailingEdge = false, TapConcurrencyMode concurrencyMode = TapConcurrencyMode.drop, int rateLimitMaxTokens = 10, Duration rateLimitRefillInterval = const Duration(seconds: 1), int rateLimitTokensPerRefill = 5, void onMetrics(TapMetrics)?, bool enabled = true, Duration? maxDuration, String? debugName})
const
TappableActionConfig.critical({bool requireNetwork = true, bool debounceTaps = true, Duration? coolDownDuration = const Duration(seconds: 2), Duration? delayBeforeFirstTapDuration = const Duration(milliseconds: 300), bool disableVisuallyDuringFirstDelay = true, Duration? minDisabledDuration = const Duration(seconds: 1), String? groupId, bool disableVisuallyDuringDebouncing = true, TapExecutionMode executionMode = TapExecutionMode.throttle, bool executeOnLeadingEdge = true, bool executeOnTrailingEdge = false, TapConcurrencyMode concurrencyMode = TapConcurrencyMode.drop, int rateLimitMaxTokens = 10, Duration rateLimitRefillInterval = const Duration(seconds: 1), int rateLimitTokensPerRefill = 5, void onMetrics(TapMetrics)?, bool enabled = true, Duration? maxDuration, String? debugName})
Conservative configuration for critical actions (payments, deletions, etc.).
const
TappableActionConfig.highFrequency({bool requireNetwork = false, bool debounceTaps = true, Duration? coolDownDuration = const Duration(milliseconds: 100), Duration? delayBeforeFirstTapDuration, bool disableVisuallyDuringFirstDelay = false, Duration? minDisabledDuration = const Duration(milliseconds: 50), String? groupId, bool disableVisuallyDuringDebouncing = false, TapExecutionMode executionMode = TapExecutionMode.highFrequency, bool executeOnLeadingEdge = true, bool executeOnTrailingEdge = false, TapConcurrencyMode concurrencyMode = TapConcurrencyMode.drop, int rateLimitMaxTokens = 10, Duration rateLimitRefillInterval = const Duration(seconds: 1), int rateLimitTokensPerRefill = 5, void onMetrics(TapMetrics)?, bool enabled = true, Duration? maxDuration, String? debugName})
Optimized configuration for high-frequency interactions.
const
TappableActionConfig.search({bool requireNetwork = true, bool debounceTaps = true, Duration? coolDownDuration = const Duration(milliseconds: 300), Duration? delayBeforeFirstTapDuration, bool disableVisuallyDuringFirstDelay = true, Duration? minDisabledDuration, String? groupId, bool disableVisuallyDuringDebouncing = false, TapExecutionMode executionMode = TapExecutionMode.debounce, bool executeOnLeadingEdge = false, bool executeOnTrailingEdge = true, TapConcurrencyMode concurrencyMode = TapConcurrencyMode.drop, int rateLimitMaxTokens = 10, Duration rateLimitRefillInterval = const Duration(seconds: 1), int rateLimitTokensPerRefill = 5, void onMetrics(TapMetrics)?, bool enabled = true, Duration? maxDuration, String? debugName})
For search inputs - debounce with trailing edge.
const
TappableActionConfig.slider({bool requireNetwork = false, bool debounceTaps = true, Duration? coolDownDuration, Duration? delayBeforeFirstTapDuration, bool disableVisuallyDuringFirstDelay = false, Duration? minDisabledDuration, String? groupId, bool disableVisuallyDuringDebouncing = false, TapExecutionMode executionMode = TapExecutionMode.rateLimited, bool executeOnLeadingEdge = true, bool executeOnTrailingEdge = false, TapConcurrencyMode concurrencyMode = TapConcurrencyMode.drop, int rateLimitMaxTokens = 20, Duration rateLimitRefillInterval = const Duration(milliseconds: 100), int rateLimitTokensPerRefill = 5, void onMetrics(TapMetrics)?, bool enabled = true, Duration? maxDuration, String? debugName})
For sliders/high-frequency - rate limited with burst capacity.
const
TappableActionConfig.toggle({bool requireNetwork = true, bool debounceTaps = true, Duration? coolDownDuration = const Duration(milliseconds: 500), Duration? delayBeforeFirstTapDuration, bool disableVisuallyDuringFirstDelay = true, Duration? minDisabledDuration, String? groupId, bool disableVisuallyDuringDebouncing = true, TapExecutionMode executionMode = TapExecutionMode.throttle, bool executeOnLeadingEdge = true, bool executeOnTrailingEdge = false, TapConcurrencyMode concurrencyMode = TapConcurrencyMode.replace, int rateLimitMaxTokens = 10, Duration rateLimitRefillInterval = const Duration(seconds: 1), int rateLimitTokensPerRefill = 5, void onMetrics(TapMetrics)?, bool enabled = true, Duration? maxDuration, String? debugName})
For like/favorite buttons - immediate feedback, replace on rapid tap.
const

Properties

concurrencyMode TapConcurrencyMode
Concurrency control for async handlers.
final
coolDownDuration Duration?
final
debounceTaps bool
final
debugName String?
Debug name for logging/troubleshooting.
final
delayBeforeFirstTapDuration Duration?
final
disableVisuallyDuringDebouncing bool
final
disableVisuallyDuringFirstDelay bool
final
enabled bool
Enable/disable toggle (bypass all logic when false).
final
executeOnLeadingEdge bool
Execute immediately on first tap (leading edge).
final
executeOnTrailingEdge bool
Execute after cooldown/pause period (trailing edge).
final
executionMode TapExecutionMode
Execution timing mode (throttle, debounce, or rate-limited). Defaults to throttle for backward compatibility.
final
groupId String?
final
hashCode int
The hash code for this object.
no setterinherited
isValid bool
Validation helper
no setter
maxDuration Duration?
Maximum duration for async operations (timeout).
final
minDisabledDuration Duration?
final
onMetrics → void Function(TapMetrics)?
Metrics callback for observability.
final
rateLimitMaxTokens int
Rate limiter config: maximum tokens in bucket (when executionMode == rateLimited).
final
rateLimitRefillInterval Duration
Rate limiter config: how often tokens are refilled.
final
rateLimitTokensPerRefill int
Rate limiter config: tokens added per refill interval.
final
requireNetwork bool
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

copyWith({bool? requireNetwork, bool? debounceTaps, Duration? coolDownDuration, Duration? delayBeforeFirstTapDuration, bool? disableVisuallyDuringFirstDelay, Duration? minDisabledDuration, String? groupId, bool? disableVisuallyDuringDebouncing, TapExecutionMode? executionMode, bool? executeOnLeadingEdge, bool? executeOnTrailingEdge, TapConcurrencyMode? concurrencyMode, int? rateLimitMaxTokens, Duration? rateLimitRefillInterval, int? rateLimitTokensPerRefill, void onMetrics(TapMetrics)?, bool? enabled, Duration? maxDuration, String? debugName}) TappableActionConfig
Create a copy with modified fields.
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