Question 1: I am trying to get values of various keys from a decoded map that was encoded to string. when I tried:
final decoded = json.decode(response.response);
myMap = decoded;
if (kDebugMode) {
print(decoded["S"][0]);
}
I kept getting the value of S but an index zero, even as 0 is also a key of another map on server
............
Question 2 Am unable to get more than one responses from the cloud function, only the last one is gotten as response, despite others are directly above it. I tried this:
res.json({
'MTN_CG_Values': mtnCGValues.toString(),
});
res.json({
'MTN_CG_Model': mtnCGModel.toString(),
});
what is mtnCGValues and mtnCGModel?
They are map @Steven
Though question 1 is resolved, remaining that of question 2
I discovered, in question 1 the map was converted to string via
.toString
Thanks for coming through
What's left is the second question
Would you pleas share what response.response is or exactly what mtnCGValues and mtnCGModel values are?
Okay
Map mtnCGModel = {
// the pattern is |quantity | network | network ID | amount
"0": ["MTN CG", 290, 170, "500MB", "30 DAYS", "1"],
"1": ["MTN CG", 291, 280, "1GB", "30 DAYS", "1"],
"2": ["MTN CG", 292, 550, "2GB", "30 DAYS", "1"],
"3": ["MTN CG", 293, 820, "3GB", "30 DAYS", "1"],
"4": ["MTN CG", 294, 1350, "5GB", "30 DAYS", "1"],
// "5": ["MTN", 294, 2500, "10GB", "30 DAYS"],
};
List mtnCGValues = [
"MTN CG 500MB",
"MTN CG 1GB",
"MTN CG 2GB",
"MTN CG 3gb",
"MTN CG 5GB",
];
so why are you doing decoded["S"]? It doesn't look like there is any "S" key
Recommended threads
- Function domain not available
Hello, even tho in docs you clearly describe that every function has its domain, I can not see it anywhere in any of my projects. How do I reveal the url of th...
- Inquiry: How to Reduce Cold Start Durati...
Hey! I was using Python for the function runtime, but after reading that Go has the fastest runtime, I switched my code over to Go. However, I'm still seeing co...
- After a GET request is passed to functio...
Create execution in the console can normally retrieve the get parameters。WHy?