Not only is the Api class the one you need to instantiate – see step 3 – but
it also exposes the scopes that represent the permissions needed to use the API.
Look under the
Constants section
of the YouTubeApi class and you’ll see the available scopes. To request access
to simply read (but not write) an end-users YouTube data, use the
youtubeReadonlyScope
when authenticating the user.

2. Enable the API

To use Google APIs you must have a Google account and a Google project. You also
need to enable your desired API.

In this example, you’d enable
YouTube Data API v3.

For details, see the
getting started instructions.

3. Authenticate the user with the required scopes

Use the google_sign_in package to
authenticate users with their Google identity. You will have to configure signin
for each platform you want to support.