writeToFile method

  1. @override
Future<File> writeToFile(
  1. Uint8List data
)
override

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));
}