/
notification_attachment.dart
44 lines (37 loc) · 1.38 KB
/
notification_attachment.dart
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/// Represents an attachment for a notification on Darwin-based operation
/// systems such as iOS and macOS
class DarwinNotificationAttachment {
/// Constructs an instance of [DarwinNotificationAttachment].
const DarwinNotificationAttachment(this.filePath, {
this.identifier,
this.hideThumbnail,
this.thumbnailClippingRect,
});
/// The local file path to the attachment.
///
/// See the documentation at https://developer.apple.com/documentation/usernotifications/unnotificationattachment?language=objc
/// for details on the supported file types and the file size restrictions.
final String filePath;
/// The unique identifier for the attachment.
///
/// When left empty, the platform's native APIs will generate a unique
/// identifier
final String? identifier;
/// Should the attachment be considered for the notification thumbnail?
final bool? hideThumbnail;
/// The clipping rectangle for the thumbnail image.
final DarwinNotificationAttachmentThumbnailClippingRect? thumbnailClippingRect;
}
/// Represents the clipping rectangle used for the thumbnail image
class DarwinNotificationAttachmentThumbnailClippingRect {
const DarwinNotificationAttachmentThumbnailClippingRect({
required this.x,
required this.y,
required this.width,
required this.height,
});
final double x;
final double y;
final double width;
final double height;
}