deleteWorksheet method

Future<bool> deleteWorksheet(
  1. Worksheet ws
)

Deletes ws.

Returns true in case of success.

Throws GSheetsException.

Implementation

Future<bool> deleteWorksheet(Worksheet ws) async {
  await GSheets.batchUpdate(_client, id, [
    {
      'deleteSheet': {'sheetId': ws.id}
    }
  ]);
  sheets.remove(ws);
  sheets.forEach((sheet) => sheet._decrementIndex(ws.index));
  return true;
}