Mil*_*ton 5 dart firebase flutter google-cloud-functions
我想知道,如何使用Cloud Functions Plugin for Flutter发送或发布(地图)列表。
我有一些这样的地图:
var customer1 = {'name':'tom','lastname':'smith'};
var customer2 = {'name':'bob','lastname':'lee'};
var customer3 = {'name':'george','lastname':'collins'};
Run Code Online (Sandbox Code Playgroud)
这些地图后来成为一个列表:
var _customerList = [customer1, customer2, customer3];
我正在尝试将此列表作为参数发送或发布到 Cloud Functions for Flutter,如下所示:
var _data = {
'customerList': _customerList,
};
final HttpsCallable callable = CloudFunctions.instance
.getHttpsCallable(functionName: 'createCustomer')
..timeout = const Duration(seconds: 30);
final HttpsCallableResult result = await callable.call(_data);
Run Code Online (Sandbox Code Playgroud)
但是,我收到此错误:
I/flutter (11486): Invalid argument: Instance of ...
如果我尝试发布一个简单的字符串,一切正常。尽管如此,我似乎没有正确发布地图列表。
我正在使用这个版本的插件:
dependencies:
cloud_functions: ^0.3.0+1
Run Code Online (Sandbox Code Playgroud)
谢谢你的帮助。
归档时间: |
|
查看次数: |
712 次 |
最近记录: |