controller
.capture(delay: Duration(milliseconds: 10))
.then((capturedImage) async {
final storageRef = FirebaseStorage.instance.ref();
final screenshotRef =
storageRef.child('/screenshot/1.jpg');
await screenshotRef.putData(capturedImage!);
final url = await screenshotRef.getDownloadURL();
final bytes = readBytes(Uri.parse(url));
var file = [
File([bytes], "imagename.jpg", {"type": "image"})
];
Map<String, dynamic> data = {
"title": "Internet Decides",
"text": "This is question",
"url": "https://internetdecides.com/test",
"files": file
};
await window.navigator.share(data);
print(url);
}).catchError((onError) {
print(onError);
});
I want to share screenshot with another app from flutter web, but when I try to fetch image from firebase then I have to run command "flutter run -d chrome --web-renderer html" to solve CORS error, but then it shows "Unsupported operation: toImage is not supported on the Web" this error.
When I try to run with "flutter run -d chrome --web-renderer canvaskit" then I got cors error, so how to solve this?