NotificationDenialInfo class
Information about when/how notification permission was denied.
Used to implement "ask again after X days" or "ask again after Y launches" logic.
Constructors
- NotificationDenialInfo({required DateTime lastDenialTime, required int denialCount, required bool isPermanent, int requestAttemptCount = 0, DateTime? lastRequestAttemptTime, bool lastRequestWasBlocked = false})
-
const
-
NotificationDenialInfo.fromJson(Map<
String, dynamic> json) -
Creates a NotificationDenialInfo from JSON.
factory
Properties
- denialCount → int
-
Total number of times permission was denied by the user.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- isPermanent → bool
-
Whether this was a permanent denial (user must go to settings).
final
- lastDenialTime → DateTime
-
When the user last denied permission.
final
- lastRequestAttemptTime → DateTime?
-
When we last attempted to request permission.
final
- lastRequestWasBlocked → bool
-
Whether the last request was blocked by the system (no dialog shown).
final
- requestAttemptCount → int
-
Total number of times we attempted to request permission.
(may be higher than denialCount if some requests were blocked)
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
copyWith(
{DateTime? lastDenialTime, int? denialCount, bool? isPermanent, int? requestAttemptCount, DateTime? lastRequestAttemptTime, bool? lastRequestWasBlocked}) → NotificationDenialInfo - Creates a copy of this NotificationDenialInfo with the given fields replaced.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, dynamic> - Converts this NotificationDenialInfo to JSON.
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited