I have tried to create folder in a flutter app in a google drive account. It shows me a bad argument(s) error. Although i am working with the documentation examples
Here is the code i have tried to do. it generates
"Bad argument(s)" error.
final _SCOPES = [drive.DriveApi.DriveScope];
void adrive(){
clientViaServiceAccount(_credentials,_SCOPES).then(onValue).catchError((e)=>print(e));
}
FutureOr onValue(AuthClient client) {
//drive.DriveApi(client).files.list().then((value)=>print(value.items[0]));
// The previous line works fine
drive.File r = new drive.File();
r.mimeType = "application/vnd.google-apps.folder";
r.title = "hello";
drive.DriveApi(client).files.insert(r,uploadOptions: commons.UploadOptions.Resumable).then((f)=>print(f.mimeType+" "+f.originalFilename))
.catchError((ex)=>print(ex.toString()));