uint8ListToXFile method
Implementation
Future<XFile> uint8ListToXFile(
{required Uint8List bytes,
String fileName = 'history_detail.png'}) async {
final tempDir = await getTemporaryDirectory();
final file = await File('${tempDir.path}/$fileName').create();
await file.writeAsBytes(bytes);
return XFile(file.path);
}