writeToFile method
Implementation
@override
Future<File> writeToFile(Uint8List data) async {
final buffer = data.buffer;
Directory tempDir = await getTemporaryDirectory();
final filePath = '${tempDir.path}/${const Uuid().v1()}.tmp';
return File(filePath).writeAsBytes(
buffer.asUint8List(data.offsetInBytes, data.lengthInBytes));
}