writeMemoryVideoToFile function
Writes a video file from memory to the specified file path.
This function takes a Uint8List of bytes representing the video data
and writes it to a file at the given filePath
. The file is flushed
to ensure all data is written to disk before returning.
Implementation
Future<File> writeMemoryVideoToFile(Uint8List bytes, String filePath) async {
final file = File(filePath);
await file.writeAsBytes(
bytes,
flush: true,
);
return file;
}