Implement writeImageToClipboard on macOS.

This commit is contained in:
2025-03-27 19:40:51 +08:00
parent d6087e5f59
commit d83d679eb9
2 changed files with 29 additions and 1 deletions

View File

@@ -15,8 +15,11 @@ Future<void> writeImageToClipboard(Uint8List imageBytes) async {
"data": Uint8List.view(data!.buffer)
});
image.dispose();
} else if (Platform.isMacOS) {
await channel.invokeMethod("writeImageToClipboard", {
"data": imageBytes,
});
} else {
// TODO: Implement for other platforms
throw UnsupportedError("Clipboard image is not supported on this platform");
}
}