颤振+;Firebase云函数-如何从HttpScalableResult获取数据
我编写了一个简单的云函数,它返回一个保存在我的CloudFireStore数据库中的id 云函数如下所示:颤振+;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
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'