transfer method

Future<void> transfer(
  1. List<SpiTransfer<SpiTransferData>> transfers
)

Implementation

Future<void> transfer(List<SpiTransfer> transfers) {
  final tuples = transfers.map((e) {
    final t = e.data._toNativeMemTransferData();
    return Tuple3(t.item1, e.properties, t.item2);
  }).toList();

  final rawTransfers = tuples.map((e) => SpiTransfer(data: e.item1, properties: e.item2)).toList();

  return transferNativeMem(rawTransfers).whenComplete(() {
    // call the postTransform callbacks for all spi transfers
    tuples.forEach((e) => e.item3());
  });
}