downloadCSV static method

void downloadCSV(
  1. String file,
  2. String fileName
)

Implementation

static void downloadCSV(String file, String fileName) async {
  Uint8List bytes = Uint8List.fromList(utf8.encode(file));
  await FileSaver.instance.saveFile(
    name: fileName,
    bytes: bytes,
    ext: 'csv',
    mimeType: MimeType.csv,
  );
}