asli
Çok geç bir cevap olacak ama belki sonradan görene yarar.
Future register()async{
var url = “http://192.168.1.37/flutter_book_notes/register.php”;
var response = await http.post(url, headers: {“ContentType”: “application/json”}, body: {
“username” : user.text,
“password” : pass.text,
});
**var data = json.decode(response.body.toString());**
if(data == "Error"){
Fluttertoast.showToast(
msg: "This User Already Exist",
toastLength: Toast.LENGTH_SHORT,
gravity: ToastGravity.CENTER,
timeInSecForIosWeb: 1,
backgroundColor: kPrimaryLightColor,
textColor: kPrimaryColor,
fontSize: 16.0,
);
}
else {
Fluttertoast.showToast(
msg: "Registration Successful",
toastLength: Toast.LENGTH_SHORT,
gravity: ToastGravity.CENTER,
timeInSecForIosWeb: 1,
backgroundColor: kPrimaryLightColor,
textColor: kPrimaryColor,
fontSize: 16.0,
);
}