NotificationDebouncer class
A specialized debouncer for handling notification-related operations.
This debouncer includes additional features specific to notification handling, such as tracking the last processed message ID to prevent duplicates.
Constructors
- NotificationDebouncer({required Duration delay})
- Creates a new notification debouncer with the specified delay.
Properties
- delay → Duration
-
The delay duration before executing the debounced function
finalinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- isActive → bool
-
Whether the debouncer is currently active (has a pending execution)
no setterinherited
- lastMessageId → String?
-
Gets the ID of the last processed message
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- timer ↔ Timer?
-
Internal timer for managing the debounce delay
getter/setter pairinherited
Methods
-
cancel(
) → void -
Cancels any pending debounced action.
inherited
-
dispose(
) → void -
Disposes of the debouncer and cancels any pending actions.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
resetLastMessageId(
) → void - Resets the last message ID, allowing the next message to be processed regardless of its ID.
-
run(
VoidCallback action) → void -
Runs the provided action after the debounce delay.
inherited
-
runAsync(
Future< void> action()) → void -
Runs the provided async action after the debounce delay.
inherited
-
runAsyncForMessage(
String? messageId, Future< void> action()) → void - Runs the async action only if the message ID is different from the last processed one.
-
runForMessage(
String? messageId, VoidCallback action) → void - Runs the action only if the message ID is different from the last processed one.
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited