首页 > 解决方案 > 理解 googleapi 文档颤动

问题描述

我完全无法理解 dart 的 GmailApi 文档。我已经实施

import 'package:googleapis/gmail/v1.dart' as gapi;
Future <gapi.ListLabelsResponse> gmailProfile() async{
  final userProfile = await gapi.GmailApi(httpClient).users.labels.list(
    uid, //this is firebase auth user id
   //$fields expected
  );
  return userProfile;
}

https://pub.dev/documentation/googleapis/latest/googleapis.gmail.v1/U​​sersLabelsResourceApi/list.html阅读, 但由于列表需要 2 个参数,其中第二个是 $fields,我不明白该放什么。

同样是为了什么

Future <gapi.ListLabelsResponse> gmailProfile() async{
  final userTrash = await gapi.GmailApi(httpClient).users.labels.list(
    uid,
    //id expected which I'm asssuming is gonna be mail's/message's id
    //$fields expected same as above
  );
  return userTrash;
}

请对我放轻松。由于没有适用GoogleApis于 dart 的实际示例,因此我正在阅读难以理解的文档来实现所有内容。

标签: flutterdartgmail-apigoogle-signin

解决方案


推荐阅读