fromReceived static method

Share fromReceived(
  1. Map received
)

Implementation

static Share fromReceived(Map received) {
  assert(received.containsKey(typeString));
  ShareType type = ShareType.fromMimeType(received[typeString]);
  if (received.containsKey(isMultipleString)) {
    List<Share> receivedShares = [];
    for (var i = 0; i < received.length - 2; i++) {
      receivedShares.add(Share.file(path: received["$i"], title: ''));
    }
    if (received.containsKey(titleString)) {
      return Share.multiple(
          mimeType: type,
          title: received[titleString],
          shares: receivedShares);
    } else {
      return Share.multiple(
          mimeType: type, shares: receivedShares, title: '');
    }
  } else {
    return _fromReceivedSingle(received, type)!;
  }
}