UReceivedShare.fromMap constructor

UReceivedShare.fromMap(
  1. Map<Object?, Object?> map
)

Reads it from the native map.

Implementation

factory UReceivedShare.fromMap(Map<Object?, Object?> map) => UReceivedShare(
  text: map["text"] as String?,
  subject: map["subject"] as String?,
  files: <UShareFile>[
    for (final Object? f in (map["files"] as List<Object?>?) ?? <Object?>[])
      if (f is Map && f["bytes"] is Uint8List)
        UShareFile.bytes(f["bytes"]! as Uint8List, name: "${f["name"] ?? "file"}", mimeType: f["mimeType"] as String?)
      else if (f is Map && f["path"] != null)
        UShareFile.path("${f["path"]}", mimeType: f["mimeType"] as String?, name: f["name"] as String?),
  ],
);