我尝试在flutter appa 中创建文件夹google drive account。它向我展示了一个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()));
Run Code Online (Sandbox Code Playgroud)