writeUint8ListtoTemporaryDirectory method
This used to write Byte data to file like image is compress or download it will
Implementation
Future<File?> writeUint8ListtoTemporaryDirectory(
{Uint8List? data, String? extension = ""}) async {
if (data == null) return null;
Directory tempDir = await pp.getTemporaryDirectory();
String tempPath = tempDir.path;
String uuid = Uuid().v4();
var filePath = tempPath + '/${uuid}.${extension}';
return new File(filePath).writeAsBytes(data);
}