2 years ago
#328823

FGY
Responsebody is null everytime
The following code is login control in Flutter. Firstly I entered true user but the response is null, then I entered false login, also the response is null. What's wrong?
Future save() async {
var res = await http.post("http://localhost:8080/signinUser",
headers: <String, String>{
'Context-Type': 'application/json;charSet=UTF-8'
},
body: <String, String>{
'email': user.email,
'password': user.password
});
print(res.body);
if(res.body!=null){
Navigator.push(
context, new MaterialPageRoute(builder: (context) => Dashboard()));
}
}
android
flutter
http
mobile
signing
0 Answers
Your Answer