transferFileInfo method
Transfer a File to WatchOS companion app
You can track the transfering progress implicitly with onProgressChanged
handler.
Return a FileTransfer
Implementation
Future<FileTransfer?> transferFileInfo(File file,
{Map<String, dynamic> metadata = const {}}) async {
Map<String, dynamic> mMetadata = Map<String, dynamic>.from(metadata);
mMetadata["id"] = getRandomString(20);
var rawFileTransferInMap = await channel.invokeMethod(
"transferFileInfo", {"filePath": file.path, "metadata": mMetadata});
if (rawFileTransferInMap != null && rawFileTransferInMap is Map) {
Map<String, dynamic> fileTransferInJson =
rawFileTransferInMap.toMapStringDynamic();
return _mapIdAndConvertFileTransfer(fileTransferInJson);
}
return null;
}