updateTitle method

Future<bool> updateTitle(
  1. String title
)

Updates title of this Worksheet.

Returns Future true in case of success.

Throws GSheetsException.

Implementation

Future<bool> updateTitle(String title) async {
  if (_title == title || title.isEmpty) {
    return false;
  }
  await GSheets.batchUpdate(_client, spreadsheetId, [
    {
      'updateSheetProperties': {
        'properties': {
          'sheetId': id,
          'title': title,
        },
        'fields': 'title',
      }
    }
  ]);
  _title = title;
  return true;
}