

(Note: credentials.json file is needed and the step to generate this file is here. The experimental implementation is as below. If you open your Google Drive, you should see a hello_word.txt file with hi inside.I am trying to retrieve filename and ID list with Google Drive API (the latest Drive API version v3 is used here) as a first step in order to analyze and manipulate these files on Google Drive. Expect the following log from the console: I/flutter (12091): Upload result: 'Instance of 'File' In the displayed list of available APIs, click the Drive API link and click Enable API. In the sidebar on the left, expand APIs & auth and select APIs. Run the app and tap on the plus button again. To enable the Drive API, complete these steps: Go to the Google API Console.

The magic numbers 104, 105, if you look them up in the ascii table, correspond to the ascii code for "h" and "i". Instead, we create an input stream from "hi" directly and upload it to Google Drive as a file "hello_world.txt". In pages like (Admin > People & Permissions > People > User list) there is a field Last Login, that seems to correctly reflect the last time the user accessed PureCloud web app. But in the spirit of keeping this demo simple, we’ll skip that. Normally, we’d open a file as a mediaStream, and upload that to Google Drive. final Stream> mediaStream = Future.value().asStream().asBroadcastStream() var media = new drive.Media(mediaStream, 2) var driveFile = new drive.File() driveFile.name = "hello_world.txt" final result = await (driveFile, uploadMedia: media) print("Upload result: $result") final authHeaders = await thHeaders final authenticateClient = GoogleAuthClient(authHeaders) final driveApi = drive.DriveApi(authenticateClient) įinally, let’s upload a file. Now we create a GoogleAuthClient with the auth headers from the user account above, and then use that to create a Google Drive API object DriveApi. Viewed 847 times 0 I am trying to retrieve filename and ID list with Google Drive API (the latest Drive API version v3 is used here) as a first step in order to analyze and manipulate these files on Google Drive. This is what the function looks like: void _incrementCounter()

Open main.dart, and locate the _incrementCounter() function, which is invoked when the user taps on the plus button. We put any here for the demo app, but you should specify the version(s) for your actual app. Open pubspec.yaml file and add these following as the dependencies: dependencies: googleapis: any google_sign_in: any
