MCPNotification class

Represents a notification in the MCP UI Runtime

Constructors

MCPNotification({required String id, required String title, String? body, NotificationType type = NotificationType.local, String channelId = 'general', NotificationImportance priority = NotificationImportance.defaultImportance, List<NotificationAction> actions = const [], Map<String, dynamic> data = const {}, String? sound, List<int>? vibrationPattern, bool enableLights = true, int? lightColor, String? largeIcon, String? bigPicture, int? progress, int? maxProgress, bool indeterminate = false, bool ongoing = false, bool autoCancel = true, DateTime? scheduledTime, Duration? repeatInterval, Duration? timeoutAfter})
const
MCPNotification.fromJson(Map<String, dynamic> json)
Creates a notification from a JSON configuration
factory

Properties

actions List<NotificationAction>
Actions that can be performed on this notification
final
autoCancel bool
Whether notification is automatically cancelled when tapped
final
bigPicture String?
Big picture for expanded notification
final
body String?
Body text of the notification
final
channelId String
ID of the notification channel
final
data Map<String, dynamic>
Additional data associated with this notification
final
enableLights bool
Whether to enable notification lights
final
hashCode int
The hash code for this object.
no setteroverride
id String
Unique identifier for this notification
final
indeterminate bool
Whether progress is indeterminate
final
largeIcon String?
Large icon for the notification
final
lightColor int?
Color of the notification light
final
maxProgress int?
Maximum progress value
final
ongoing bool
Whether notification is ongoing (can't be dismissed by user)
final
priority NotificationImportance
Priority/importance of this notification
final
progress int?
Current progress (for progress notifications)
final
repeatInterval Duration?
Interval for repeating notifications
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
scheduledTime DateTime?
When this notification should be shown (for scheduled notifications)
final
sound String?
Sound to play (path or identifier)
final
timeoutAfter Duration?
How long to show the notification before auto-dismissing
final
title String
Title of the notification
final
type NotificationType
Type of notification
final
vibrationPattern List<int>?
Custom vibration pattern
final

Methods

copyWith({String? id, String? title, String? body, NotificationType? type, String? channelId, NotificationImportance? priority, List<NotificationAction>? actions, Map<String, dynamic>? data, String? sound, List<int>? vibrationPattern, bool? enableLights, int? lightColor, String? largeIcon, String? bigPicture, int? progress, int? maxProgress, bool? indeterminate, bool? ongoing, bool? autoCancel, DateTime? scheduledTime, Duration? repeatInterval, Duration? timeoutAfter}) MCPNotification
Creates a copy of this notification with modified properties
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() Map<String, dynamic>
Converts this notification to JSON
toString() String
A string representation of this object.
override

Operators

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