getImageFileFromAssets static method

Future<File> getImageFileFromAssets(
  1. ByteData byteData
)

Implementation

static Future<File> getImageFileFromAssets(ByteData byteData) async {
  final file = File(
    '${(await getAppDirectory()).path}${DateTime.now().millisecond}.jpg',
  );
  await file.writeAsBytes(byteData.buffer.asUint8List(byteData.offsetInBytes, byteData.lengthInBytes));

  return file;
}