Right now I use the method clientViaUserConsent, to authenticate my user and thus be able to use the Google API, in this case, calendar api, the problem is that the way it is built now requests this permission every time the user enters the app, this it is a problem since it is annoying for the user,
Is there a way to do this automatically by refreshing the authentication token in the background every time the user enters the app?
I understand the idea of storing the token and the refresh token but I don't know how to implement it
here is my code:
var _clientID = new ClientId(Secret.getId(), "");
const _scopes = const [cal.CalendarApi.calendarScope];
await clientViaUserConsent(_clientID, _scopes, Prompt.prompt).then((AuthClient client) async {
CalendarClient.calendar = cal.CalendarApi(client);
print(client);
});