Skip to content

Commit 754a773

Browse files
committed
Make SharedAttachment in ShareMedia non-nullable, because ShareAttachment.decode takes a non-nullable parameter any ways
1 parent b0f0a7a commit 754a773

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

share_handler_platform_interface/lib/src/data/messages.dart

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ class SharedMedia {
5757
});
5858

5959
/// List of shared attachments (ex. images, videos, pdfs, etc.). Each attachment has an attachment type and a path to the file on the device.
60-
List<SharedAttachment?>? attachments;
60+
List<SharedAttachment>? attachments;
6161

6262
/// iOS only: List of recipient identifiers from iOS intent.
6363
List<String?>? recipientIdentifiers;
@@ -96,9 +96,8 @@ class SharedMedia {
9696
static SharedMedia decode(Object message) {
9797
final Map<Object?, Object?> pigeonMap = message as Map<Object?, Object?>;
9898
return SharedMedia(
99-
attachments: (pigeonMap['attachments'] as List<Object?>?)
100-
?.map((e) => SharedAttachment.decode(e as Map<Object?, Object?>))
101-
.cast<SharedAttachment?>()
99+
attachments: (pigeonMap['attachments'] as List<Object>?)
100+
?.map((e) => SharedAttachment.decode(e as Map<Object, Object?>))
102101
.toList(),
103102
recipientIdentifiers: (pigeonMap['recipientIdentifiers'] as List<Object?>?)?.cast<String?>(),
104103
conversationIdentifier: pigeonMap['conversationIdentifier'] as String?,

0 commit comments

Comments
 (0)