Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/firebase/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
颤振+;Firebase云函数-如何从HttpScalableResult获取数据_Firebase_Flutter_Google Cloud Functions - Fatal编程技术网

颤振+;Firebase云函数-如何从HttpScalableResult获取数据

颤振+;Firebase云函数-如何从HttpScalableResult获取数据,firebase,flutter,google-cloud-functions,Firebase,Flutter,Google Cloud Functions,我编写了一个简单的云函数,它返回一个保存在我的CloudFireStore数据库中的id 云函数如下所示: exports.getWinkert = functions.https.onCall((data, context) => { return admin.firestore().collection('users').doc('hash').get() .then(snapshot => { const winkertId = snapsh

我编写了一个简单的云函数,它返回一个保存在我的CloudFireStore数据库中的id

云函数如下所示:


exports.getWinkert = functions.https.onCall((data, context) => {

    return admin.firestore().collection('users').doc('hash').get()
    .then(snapshot => {
        const winkertId = snapshot.wwinkert
        return { id: winkertId };
    })
})

使用以下代码从我的颤振应用程序调用此函数:


Future _getValues() async {
    final HttpsCallable callable = CloudFunctions.instance.getHttpsCallable(
      functionName: "getWinkert",
    );
    dynamic resp = await callable.call(<String, dynamic>{
      "name": "wwinkert",
    });
    print(resp.toString());
  }

问题:如何从Dart中的HttpScalableResult实例获取数据

提前感谢您的帮助

问候,
Raul

快速浏览此文档:

揭示了可以通过向HttpScalableResult对象添加.data来获取数据

。 .


我的道歉:D

要为其他用户澄清这件事,您可以获得如下相应数据['id']的id;这个链接断了
I/flutter ( 8253): Instance of 'HttpsCallableResult'