![]() ![]() 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. 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 ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |