UNotificationRequest class
Everything a notification can carry. Platforms ignore what they cannot show.
- Annotations
Constructors
-
UNotificationRequest({required int id, String? title, String? body, String? subtitle, Map<
String, Object?> ? payload, String? image, String? largeIcon, String? channelId, UNotificationImportance importance = UNotificationImportance.high, String? group, bool groupSummary = false, List<UNotificationAction> actions = const <UNotificationAction>[], UNotificationProgress? progress, bool ongoing = false, bool autoCancel = true, bool silent = false, String? sound, int? badge, int? color, Duration? timeout, bool fullScreen = false, UNotificationVisibility visibility = UNotificationVisibility.private, List<String> lines = const <String>[], bool chronometer = false, DateTime? when, UNotificationInterruption interruption = UNotificationInterruption.active, double? relevance, String? category}) -
const
Properties
-
actions
→ List<
UNotificationAction> -
Buttons and reply fields.
final
- autoCancel → bool
-
Removes it when tapped.
final
- badge → int?
-
App icon badge number carried with the notification (iOS / macOS / Android launcher).
final
- body → String?
-
Main text.
final
- category → String?
-
Android category: alarm, call, email, event, message, progress, reminder, …
final
- channelId → String?
-
Android channel; created from importance when omitted.
final
- chronometer → bool
-
Shows a running timer since when (Android).
final
- color → int?
-
Accent colour (Android).
final
- fullScreen → bool
-
Full-screen alert like an incoming call (Android; needs USE_FULL_SCREEN_INTENT).
final
- group → String?
-
Groups related notifications (Android group, iOS thread, Windows group).
final
- groupSummary → bool
-
Makes this the summary of its group (Android).
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- id → int
-
Same id replaces / updates an existing notification.
final
- image → String?
-
Big picture (local file path; URLs are downloaded first).
final
- importance → UNotificationImportance
-
How loud it is.
final
- interruption → UNotificationInterruption
-
Apple focus level: passive, active, timeSensitive, critical.
final
- largeIcon → String?
-
Round image next to the text (local file path or URL).
final
-
lines
→ List<
String> -
Inbox style: one line each.
final
- ongoing → bool
-
Cannot be swiped away (Android).
final
-
payload
→ Map<
String, Object?> ? -
Returned in taps and actions.
final
- progress → UNotificationProgress?
-
Progress bar.
final
- relevance → double?
-
0-1: which notification leads the summary (iOS 15+).
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- silent → bool
-
No sound or vibration.
final
- sound → String?
-
Custom sound: Android res/raw name, iOS bundle file name, Windows ms-winsoundevent URI.
final
- subtitle → String?
-
Second line (Apple subtitle, Android sub-text).
final
- timeout → Duration?
-
Removed automatically after this long.
final
- title → String?
-
Title.
final
- visibility → UNotificationVisibility
-
What shows on the lock screen.
final
- when → DateTime?
-
Time shown on the notification.
final
Methods
-
copyWith(
{String? image, String? largeIcon}) → UNotificationRequest - Copy with some fields changed.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toMap(
) → Map< String, Object?> - As a map.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited