I trying to create a spread sheet in using Google Sheets API, I have Enabled Google Sheets API in console in google cloud but still getting error.
Below Is Code I am Using.
final authClient =
await GoogleSignInProvider.googleSigniIn.authenticatedClient();
if (authClient != null) {
final SheetsApi sheetapi = SheetsApi(authClient);
Spreadsheet sheet = Spreadsheet();
sheet.properties?.title = 'Title';
sheet = await sheetapi.spreadsheets.create(sheet);
log(sheet.spreadsheetId.toString());
}
ERROR
Exception has occurred.DetailedApiRequestError (DetailedApiRequestError(status: 403, message: Google Sheets API has not been used in project xxxxxxxxxxxx before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/sheets.googleapis.com/overview?project=xxxxxxxxxxxx then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry.))
I have already tried Enabling And Disabling it. How Can I Solve this?