I'm making a call using Dio that send some query parameters, using map constructor
response = await Dio().get(url, queryParameters: {
"apikey": publicKey,
"hash": hash,
"ts": timestamp,
"nameStartsWith": searchTerm
});
Everything works correctly, but when try to send a int value, Dio throw a error
response = await Dio().get(url, queryParameters: {
"apikey": publicKey,
"hash": hash,
"ts": timestamp,
"nameStartsWith": searchTerm,
"page" : 10
});
type 'int' is not a subtype of type 'Iterable < dynamic > '#0
And i can't just convert the int value to string, because api is expcting int type.
Any help ?
There is no such thing as an int type in an URL and therefore in query parameters.
An URL can only be a String.
Just convert it to String and be done.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With