I am trying to learn how to use dart and flutter by re-building an app I\'ve previously coded in Java, which involves getting events from a Google Calendar using Google\'s o
I was able to get this working using your code with one change (step 6). First, ensure server-side is correctly setup (steps 1-5).
Google Developer Console
1. create project
2. enable calendar api
3. create service account - download json credentials
Google Calendar Settings
4. share with specific people - add email of service account
5. copy Calendar ID (alphanumericstring@group.calendar.google.com)
Your Code
6. replace "primary" with Calendar ID from step 5
There's a well-done overview of steps 1-5 at https://murze.be/how-to-setup-and-use-the-google-calendar-api. They are for PHP, but the Google-side setup is the same.
Hope this helps someone.