我正在使用 Dio 进行调用,使用 map 构造函数发送一些查询参数
response = await Dio().get(url, queryParameters: {
"apikey": publicKey,
"hash": hash,
"ts": timestamp,
"nameStartsWith": searchTerm
});
Run Code Online (Sandbox Code Playgroud)
一切正常,但是当尝试发送 int 值时,Dio 抛出错误
response = await Dio().get(url, queryParameters: {
"apikey": publicKey,
"hash": hash,
"ts": timestamp,
"nameStartsWith": searchTerm,
"page" : 10
});
Run Code Online (Sandbox Code Playgroud)
'int' 类型不是 'Iterable < dynamic > '#0 类型的子类型
而且我不能只是将 int 值转换为字符串,因为 api 正在使用 int 类型。
有什么帮助吗?
归档时间: |
|
查看次数: |
5711 次 |
最近记录: |