export method

Future<File> export(
  1. File file,
  2. ExportFormat format, {
  3. int? worksheetId,
})

Exports spreadsheet in specified format and writes it to file

worksheetId - the worksheet id that will be exported, if not specified the whole spreadsheet will be exported

Returns Future

Implementation

Future<File> export(
  File file,
  ExportFormat format, {
  int? worksheetId,
}) async {
  final bytes = await GSheets.export(
    client: _client,
    spreadsheetId: id,
    spreadsheetUrl: url,
    format: format,
    worksheetId: worksheetId,
  );
  return file.writeAsBytes(bytes);
}