saveFile static method

Future<bool> saveFile(
  1. String fileName,
  2. String content
)

This method saves the given content to the file with the given fileName in the application documents directory.

Implementation

static Future<bool> saveFile(String fileName, String content) async {
  File file = File(await getFilePath(fileName));
  file.writeAsString(content);
  return true;
}