Hi I have a question about reading a json using flutter
The code below returns in the string value -> {"return": 2}. But when I print the valuemap.values I have the following result: (2).
How do I do it to read only the integer value? ,
Dart Code:
Future<int> login(String Email, String Password) async {
//Ret rappresenta il valore di ritorno della funzione
var ret=0;
Map map={
'Username': Email,
'Password':Password
};
String value=await apiRequest("/login", map);
print("Valore prima del parse:" +value);
Map valueMap = json.decode(value);
print("Stampa di valore:" + valueMap.values.toString());
return ret;
}
print("Stampa di valore:" + valueMap['return'].toString());