writeFileAsString method

Future<String> writeFileAsString({
  1. required String fileName,
  2. required String data,
})

Write data inside fileName and return the path to the file.

Files are saved in the following locations:

  • Android: Device's external downloads directory.
  • iOS: Application's Documents directory.
  • MacOS: Applications's Documents directory.
  • Web: Browser's downloads directory.

MacOS only: This method will also open the finder pointing to the folder containing the file.

Implementation

Future<String> writeFileAsString({
  required String fileName,
  required String data,
}) =>
    _platform.writeFileAsString(
      fileName: fileName,
      data: data,
    );