saveAndShare method Null safety
Saves and shares the image.
Returns a Future
.
Implementation
static Future saveAndShare(Uint8List bytes) async {
final directory = await getApplicationDocumentsDirectory();
final image = File('${directory.path}/flutter.png');
image.writeAsBytesSync(bytes);
XFile f = XFile(image.path);
await Share.shareXFiles([f]);
}