LongTimeNoNotification class

For example, this class can be useful when a notification is confirmed and should not be displayed for a few days.

You can choose not to display the notification forever or for a certain period of time.

Properties

hashCode int
The hash code for this object.
no setterinherited
isForever bool
If notification was closed with setForever, this will return true.
no setter
lastDisplayAt DateTime?
DateTime last displayed.
no setter
nextDisplayAt DateTime?
DateTime to be displayed next.
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
shouldNotify() bool
If DateTime.now() is after nextDisplayAt, this returns true.
toString() String
A string representation of this object.
inherited

Operators

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

Static Methods

clear(List<String> ids) Future<bool>
Deletes data from SharedPreferences for the notification whose IDs are passed as an argument.
clearAll() Future<bool>
Deletes all notification data from SharedPreferences.
findBy(String id) Future<LongTimeNoNotification?>
Retrieves the corresponding ID's notification data from SharedPreferences.
setDuration({required String id, required Duration duration}) Future<LongTimeNoNotification>
From the date and time this method is called, the notification for the target ID will not be displayed for the Duration passed as an argument.
setForever({required String id}) Future<LongTimeNoNotification>
Prevent the notification of the target ID from being displayed forever.
setNext({required String id, required DateTime nextDisplayAt}) Future<LongTimeNoNotification>
Notifications for the target ID will not be displayed until the nextDisplayAt passed in the argument.