saveToDownloadsIos static method

Future<bool> saveToDownloadsIos(
  1. String content,
  2. String fileName,
  3. String extension
)

Implementation

static Future<bool> saveToDownloadsIos(
    String content, String fileName, String extension) async {
  try {
    Directory downloadDirectory = await getDownloadDirectory();
    final filePath = '${downloadDirectory.path}/$fileName.$extension';
    final file = File(filePath);
    await file.writeAsString(content);
    return true;
  } catch (e) {
    return false;
  }
}