Member-only story

How to Use the Google Drive API With Flutter Apps

Tap into the power of Google Drive

Yuchen Z.
Better Programming

Photo by Stephen Frank on Unsplash

Google APIs are a huge umbrella. Check out the almost 200 entries from the Google API explorer. Among all these APIs, some of popular ones include: Google Drive, Gmail, Cloud Datastore, Google Cloud Storage, etc. Today, let’s take a look at what it takes to integrate the Google Drive API into a Flutter app.

There are many interesting aspect of Google Drive API. But one of the most interesting ones that I find are that it gives cloud storage for your user data without having to actually build, maintain, and pay for cloud storage. Say you were to build a simple TODO app, you could use Google Drive to back up and restore the user’s TODO items.

To follow this article, it’s recommended that you have some basic knowledge about Dart and Flutter. But if not, look through the getting started doc from here first. Otherwise, the coding side of this blog post is relatively light and hopefully it won’t be too hard to follow.

Let’s get into it.

Dependencies

We’ll be depending on two packages:

  • googleapis which contains the library for accessing Google Drive. Google Drive, same as other open APIs from Google, has RESTful endpoints. But using the SDK is…

Create an account to read the full story.

The author made this story available to Medium members only.
If you’re new to Medium, create a new account to read this story on us.

Or, continue in mobile web

Already have an account? Sign in

Responses (8)

What are your thoughts?

thanks but I have question
how can I enable users to upload files or images on my google drive not their google drive?

--

Hi, How can I get all files of my google drive Sir. This project is to upload file. Please give more answer. Thank you sir.

--

Hi Yuchen, thank you very much, very interesting article. I have followed the tutorial and I am getting this error:
Member not found: 'DriveScope'.
final googleSignIn = signIn.GoogleSignIn.standard(scopes: [drive.DriveApi.DriveScope]);
And this one:
Erro…

--