- Edited
merhabalar api ile login işlemi yapmak istiyorum ama tıkandım kaldım sign in isimli bi metodum var şu şekilde ` signIn(String email, pass) async {
SharedPreferences sharedPreferences = await SharedPreferences.getInstance();
if (emailController.text == "a"&& passwordController.text == "a") {
Navigator.of(context).pushAndRemoveUntil(
MaterialPageRoute(builder: (BuildContext context) => MainScreen()), (
Route<dynamic> route) => false);
print("sucsesful");
Map data = {
'uye_name': emailcontroller.text,
'pasw': passwordController.text
};
var response = await http.post("http://10.0.2.2:3000/uyeler", );
response = await http.post('http://10.0.2.2:3000/uyeler',
body: {"uye_name": email, "pasw": pass},);
}
else {
Navigator.of(context).pushAndRemoveUntil(
MaterialPageRoute(builder: (BuildContext context) => LoginPage1()), (
Route<dynamic> route) => false);
setState(() {
_isLoading = true;
});
showDialog(context: context,
builder: (BuildContext context) {
return AlertDialog(
title: new Text("Hatalı girdiniz"),
content: new Text("Lütfen giriş bilgilerini kontrol ediniz"),
actions: <Widget>[
new FlatButton(child: new Text("Kapat"),
onPressed: () {
Navigator.of(context).pop();
},
),
],
);
}
);
}
}
` ama apiden gelen datayı kontrol edemiyorum. geçici olarak kuladi ve sifreyi a a yaptım sorun yok o kısmı dinamik olarak apiden çekebilisem sorun kalmayacak gibi