⚠ This plugin is a work in progress, use at your own risk ⚠
A flutter plugin that wraps wormhole-william into a Dart API.
Supported functionality
- Send/Receive files
- Send/Receive text
Sending files:
final client = Client();
client.sendFile(File("/home/user/hello.txt")).then((codegenResult) {
print("Enter ${codegenResult.code} to receive the file");
});
Receiving files:
final client = Client();
final download = client.recvFile("1-revenue-gazelle");
download.pendingDownload.accept(File("/home/user/${download.pendingDownload.fileName}"));
download.done.then((result) {
print("Received file ${download.pendingDownload.fileName}");
});
Currently this plugin is only buildable as part of the build for this app.
Dart does not support callbacks from wormhole-william
from multiple threads. The
plugin implements function calls by sending the arguments to a
Dart send port and handling
the messages to resolve on Dart. The C stack is kept in a busy loop until the
dart function is completed. Once this issue
is resolved, we can cleanup that code to be much simpler and less error prone.